libzypp  13.10.6
RepoStatus.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP2_REPOSTATUS_H
13 #define ZYPP2_REPOSTATUS_H
14 
15 #include <iosfwd>
16 #include "zypp/base/PtrTypes.h"
17 #include "zypp/CheckSum.h"
18 #include "zypp/Date.h"
19 
21 namespace zypp
22 {
23 
25  //
26  // CLASS NAME : RepoStatus
27  //
37  class RepoStatus
38  {
39  friend std::ostream & operator<<( std::ostream & str, const RepoStatus & obj );
40 
41  public:
42 
50  static RepoStatus fromCookieFile( const Pathname &path );
51 
56  void saveToCookieFile( const Pathname &path ) const;
57 
64  std::string checksum() const;
65 
71  Date timestamp() const;
72 
79  bool empty() const;
80 
85  RepoStatus & setChecksum( const std::string &checksum );
86 
91  RepoStatus & setTimestamp( const Date &timestamp );
92 
94  class Impl;
95 
96  public:
98  RepoStatus();
99 
117  RepoStatus( const Pathname &file );
118 
120  ~RepoStatus();
121 
122  public:
123 
124  private:
127  };
129 
131  std::ostream & operator<<( std::ostream & str, const RepoStatus & obj );
132 
137  RepoStatus operator&&( const RepoStatus &lhs, const RepoStatus &rhs );
138 
140 } // namespace zypp
142 #endif // ZYPP2_REPOSTATUS_H
Date timestamp() const
timestamp of the repository.
Definition: RepoStatus.cc:144
std::string checksum() const
Checksum of the repository.
Definition: RepoStatus.cc:141
RepoStatus & setTimestamp(const Date &timestamp)
set the repository timestamp
Definition: RepoStatus.cc:135
bool empty() const
Is the status empty?
Definition: RepoStatus.cc:124
RepoStatus operator&&(const RepoStatus &lhs, const RepoStatus &rhs)
combines 2 repostatus with a checksum based on both checksums and the newest timestamp ...
Definition: RepoStatus.cc:147
RepoStatus()
Default ctor.
Definition: RepoStatus.cc:71
static RepoStatus fromCookieFile(const Pathname &path)
reads the status from a file which contains the checksum and timestamp in each line.
Definition: RepoStatus.cc:97
Store and operate on date (time_t).
Definition: Date.h:31
friend std::ostream & operator<<(std::ostream &str, const RepoStatus &obj)
Definition: RepoStatus.cc:170
std::ostream & operator<<(std::ostream &str, const Exception &obj)
Definition: Exception.cc:120
void saveToCookieFile(const Pathname &path) const
save the status information to a cookie file
Definition: RepoStatus.cc:114
RepoStatus & setChecksum(const std::string &checksum)
set the repository checksum
Definition: RepoStatus.cc:129
RepoStatus implementation.
Definition: RepoStatus.cc:31
~RepoStatus()
Dtor.
Definition: RepoStatus.cc:94
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
Definition: RepoStatus.h:126
Local facts about a repository This class represents the status of a repository on the system...
Definition: RepoStatus.h:37
RW_pointer supporting &#39;copy on write&#39; functionality.
Definition: PtrTypes.h:438