libzypp  11.13.5
HistoryLogData.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
9 
13 #ifndef ZYPP_HISTORYLOGDATA_H_
14 #define ZYPP_HISTORYLOGDATA_H_
15 
16 #include <iosfwd>
17 
18 #include "zypp/Date.h"
19 #include "zypp/Edition.h"
20 #include "zypp/Arch.h"
21 #include "zypp/CheckSum.h"
22 #include "zypp/Url.h"
23 
24 #define HISTORY_LOG_DATE_FORMAT "%Y-%m-%d %H:%M:%S"
25 
26 namespace zypp
27 {
28 
29 
31  //
32  // CLASS NAME : HistoryActionID
33  //
40  {
41  static const HistoryActionID NONE;
42 
43  static const HistoryActionID INSTALL;
44  static const HistoryActionID REMOVE;
45  static const HistoryActionID REPO_ADD;
49 
50  enum ID
51  {
53 
60  };
61 
63 
64  HistoryActionID(ID id) : _id(id) {}
65 
66  explicit HistoryActionID(const std::string & strval_r);
67 
68  ID toEnum() const { return _id; }
69 
70  static HistoryActionID::ID parse(const std::string & strval_r);
71 
72  const std::string & asString(bool pad = false) const;
73 
74  private:
76  };
77 
79  std::ostream & operator << (std::ostream & str, const HistoryActionID & id);
81 
82 
84  //
85  // CLASS NAME: HistoryItem
86  //
88  {
89  public:
90  typedef shared_ptr<HistoryItem> Ptr;
91  typedef std::vector<std::string> FieldVector;
92 
93  public:
94  HistoryItem(FieldVector & fields);
95  virtual ~HistoryItem()
96  {}
97 
98  virtual void dumpTo(std::ostream & str) const;
99 
100  public:
103  };
105 
106 
108  //
109  // CLASS NAME: HistoryItemInstall
110  //
112  {
113  public:
114  typedef shared_ptr<HistoryItemInstall> Ptr;
115 
118  {}
119 
120  virtual void dumpTo(std::ostream & str) const;
121 
122  public:
123  std::string name;
126  std::string reqby; // TODO make this a class ReqBy
127  std::string repoalias;
129  };
131 
132 
134  //
135  // CLASS NAME: HistoryItemRemove
136  //
138  {
139  public:
140  typedef shared_ptr<HistoryItemRemove> Ptr;
141 
142  HistoryItemRemove(FieldVector & fields);
144  {}
145 
146  virtual void dumpTo(std::ostream & str) const;
147 
148  public:
149  std::string name;
152  std::string reqby;
153  };
155 
156 
158  //
159  // CLASS NAME: HistoryItemRepoAdd
160  //
162  {
163  public:
164  typedef shared_ptr<HistoryItemRepoAdd> Ptr;
165 
168  {}
169 
170  virtual void dumpTo(std::ostream & str) const;
171 
172  public:
173  std::string alias;
175  };
177 
178 
180  //
181  // CLASS NAME: HistoryItemRepoRemove
182  //
184  {
185  public:
186  typedef shared_ptr<HistoryItemRepoRemove> Ptr;
187 
190  {}
191 
192  virtual void dumpTo(std::ostream & str) const;
193 
194  public:
195  std::string alias;
196  };
198 
199 
201  //
202  // CLASS NAME: HistoryItemRepoAliasChange
203  //
205  {
206  public:
207  typedef shared_ptr<HistoryItemRepoAliasChange> Ptr;
208 
211  {}
212 
213  virtual void dumpTo(std::ostream & str) const;
214 
215  public:
216  std::string oldalias;
217  std::string newalias;
218  };
220 
221 
223  //
224  // CLASS NAME: HistoryItemRepoUrlChange
225  //
227  {
228  public:
229  typedef shared_ptr<HistoryItemRepoUrlChange> Ptr;
230 
233  {}
234 
235  virtual void dumpTo(std::ostream & str) const;
236 
237  public:
238  std::string alias;
240  };
242 
243  std::ostream & operator<<(std::ostream & str, const HistoryItem & obj);
244 
245 }
246 
247 #endif /* ZYPP_HISTORYLOGDATA_H_ */