libzypp  17.30.2
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 
24  class RepoInfo;
25 
40  class RepoStatus
41  {
42  friend std::ostream & operator<<( std::ostream & str, const RepoStatus & obj );
43  friend RepoStatus operator&&( const RepoStatus & lhs, const RepoStatus & rhs );
44  friend bool operator==( const RepoStatus & lhs, const RepoStatus & rhs );
45 
46  public:
48  RepoStatus();
49 
55  explicit RepoStatus( const Pathname & path_r );
56 
58  explicit RepoStatus( const RepoInfo & info_r );
59 
61  RepoStatus( std::string checksum_r, Date timestamp_r );
62 
64  ~RepoStatus();
65 
66  public:
72  static RepoStatus fromCookieFile( const Pathname & path );
73 
78  void saveToCookieFile( const Pathname & path_r ) const;
79 
80  public:
82  bool empty() const;
83 
85  Date timestamp() const;
86 
87  public:
88  struct Impl;
89  private:
91  };
93 
95  std::ostream & operator<<( std::ostream & str, const RepoStatus & obj );
96 
98  RepoStatus operator&&( const RepoStatus & lhs, const RepoStatus & rhs );
99 
101  bool operator==( const RepoStatus & lhs, const RepoStatus & rhs );
102 
104  inline bool operator!=( const RepoStatus & lhs, const RepoStatus & rhs )
105  { return ! ( lhs == rhs ); }
106 
108 } // namespace zypp
110 #endif // ZYPP2_REPOSTATUS_H
Store and operate on date (time_t).
Definition: Date.h:33
What is known about a repository.
Definition: RepoInfo.h:72
Track changing files or directories.
Definition: RepoStatus.h:41
RWCOW_pointer< Impl > _pimpl
Implementation.
Definition: RepoStatus.h:88
static RepoStatus fromCookieFile(const Pathname &path)
Reads the status from a cookie file.
Definition: RepoStatus.cc:194
Date timestamp() const
The time the data were changed the last time.
Definition: RepoStatus.cc:225
bool empty() const
Whether the status is empty (empty checksum)
Definition: RepoStatus.cc:222
friend bool operator==(const RepoStatus &lhs, const RepoStatus &rhs)
Definition: RepoStatus.cc:238
friend RepoStatus operator&&(const RepoStatus &lhs, const RepoStatus &rhs)
Definition: RepoStatus.cc:231
friend std::ostream & operator<<(std::ostream &str, const RepoStatus &obj)
Definition: RepoStatus.cc:228
RepoStatus()
Default ctor.
Definition: RepoStatus.cc:156
void saveToCookieFile(const Pathname &path_r) const
Save the status information to a cookie file.
Definition: RepoStatus.cc:212
bool operator!=(const RepoStatus &lhs, const RepoStatus &rhs)
Whether 2 RepoStatus refer to different content checksums.
Definition: RepoStatus.h:104
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
bool operator==(const SetRelation::Enum &lhs, const SetCompare &rhs)
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
Definition: SerialNumber.cc:52
RepoStatus operator&&(const RepoStatus &lhs, const RepoStatus &rhs)
Definition: RepoStatus.cc:231
RW_pointer supporting 'copy on write' functionality.
Definition: PtrTypes.h:459
RepoStatus implementation.
Definition: RepoStatus.cc:58