libzypp  17.32.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();
54  explicit RepoStatus( const Pathname & path_r );
55 
57  explicit RepoStatus( const RepoInfo & info_r );
58 
60  RepoStatus( std::string checksum_r, Date timestamp_r );
61 
63  ~RepoStatus();
64 
65  RepoStatus(const RepoStatus &) = default;
66  RepoStatus(RepoStatus &&) noexcept = default;
67  RepoStatus &operator=(const RepoStatus &) = default;
68  RepoStatus &operator=(RepoStatus &&) noexcept = default;
69 
70  public:
76  static RepoStatus fromCookieFile( const Pathname & path );
77 
82  void saveToCookieFile( const Pathname & path_r ) const;
83 
84  public:
86  bool empty() const;
87 
89  Date timestamp() const;
90 
91  public:
92  struct Impl;
93  private:
95  };
97 
99  std::ostream & operator<<( std::ostream & str, const RepoStatus & obj );
100 
102  RepoStatus operator&&( const RepoStatus & lhs, const RepoStatus & rhs );
103 
105  bool operator==( const RepoStatus & lhs, const RepoStatus & rhs );
106 
108  inline bool operator!=( const RepoStatus & lhs, const RepoStatus & rhs )
109  { return ! ( lhs == rhs ); }
110 
112 } // namespace zypp
114 #endif // ZYPP2_REPOSTATUS_H
bool empty() const
Whether the status is empty (empty checksum)
Definition: RepoStatus.cc:222
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
Definition: SerialNumber.cc:52
What is known about a repository.
Definition: RepoInfo.h:71
bool operator==(const SetRelation::Enum &lhs, const SetCompare &rhs)
RepoStatus()
Default ctor.
Definition: RepoStatus.cc:156
static RepoStatus fromCookieFile(const Pathname &path)
Reads the status from a cookie file.
Definition: RepoStatus.cc:194
void saveToCookieFile(const Pathname &path_r) const
Save the status information to a cookie file.
Definition: RepoStatus.cc:212
Store and operate on date (time_t).
Definition: Date.h:32
friend std::ostream & operator<<(std::ostream &str, const RepoStatus &obj)
Definition: RepoStatus.cc:228
RepoStatus & operator=(const RepoStatus &)=default
friend RepoStatus operator &&(const RepoStatus &lhs, const RepoStatus &rhs)
Definition: RepoStatus.cc:231
bool operator!=(const RepoStatus &lhs, const RepoStatus &rhs)
Definition: RepoStatus.h:108
friend bool operator==(const RepoStatus &lhs, const RepoStatus &rhs)
Definition: RepoStatus.cc:238
RepoStatus implementation.
Definition: RepoStatus.cc:57
~RepoStatus()
Dtor.
Definition: RepoStatus.cc:191
Date timestamp() const
The time the data were changed the last time.
Definition: RepoStatus.cc:225
RWCOW_pointer< Impl > _pimpl
Implementation.
Definition: RepoStatus.h:92
Track changing files or directories.
Definition: RepoStatus.h:40
RepoStatus operator &&(const RepoStatus &lhs, const RepoStatus &rhs)
Definition: RepoStatus.cc:231
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1