1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
10 /** \file zypp/HistoryLogData.h
13 #ifndef ZYPP_HISTORYLOGDATA_H_
14 #define ZYPP_HISTORYLOGDATA_H_
16 #include "zypp/Date.h"
17 #include "zypp/Edition.h"
18 #include "zypp/Arch.h"
19 #include "zypp/CheckSum.h"
22 #define HISTORY_LOG_DATE_FORMAT "%Y-%m-%d %H:%M:%S"
28 ///////////////////////////////////////////////////////////////////
30 // CLASS NAME : HistoryActionID
33 * Enumeration of known history actions.
35 * \ingroup g_EnumerationClass
37 struct HistoryActionID
39 static const HistoryActionID NONE;
41 static const HistoryActionID INSTALL;
42 static const HistoryActionID REMOVE;
43 static const HistoryActionID REPO_ADD;
44 static const HistoryActionID REPO_REMOVE;
45 static const HistoryActionID REPO_CHANGE_ALIAS;
46 static const HistoryActionID REPO_CHANGE_URL;
60 HistoryActionID() : _id(NONE_e) {}
62 HistoryActionID(ID id) : _id(id) {}
64 explicit HistoryActionID(const std::string & strval_r);
66 ID toEnum() const { return _id; }
68 static HistoryActionID::ID parse(const std::string & strval_r);
70 const std::string & asString(bool pad = false) const;
76 /** \relates HistoryActionID */
77 std::ostream & operator << (std::ostream & str, const HistoryActionID & id);
78 ///////////////////////////////////////////////////////////////////
81 /////////////////////////////////////////////////////////////////////
83 // CLASS NAME: HistoryItem
88 typedef shared_ptr<HistoryItem> Ptr;
89 typedef std::vector<std::string> FieldVector;
92 HistoryItem(FieldVector & fields);
93 virtual ~HistoryItem()
98 HistoryActionID action;
100 /////////////////////////////////////////////////////////////////////
103 /////////////////////////////////////////////////////////////////////
105 // CLASS NAME: HistoryItemInstall
107 class HistoryItemInstall : public HistoryItem
110 typedef shared_ptr<HistoryItemInstall> Ptr;
112 HistoryItemInstall(FieldVector & fields);
113 virtual ~HistoryItemInstall()
116 virtual const std::string asString() const;
122 std::string reqby; // TODO make this a class ReqBy
123 std::string repoalias;
126 /////////////////////////////////////////////////////////////////////
129 /////////////////////////////////////////////////////////////////////
131 // CLASS NAME: HistoryItemRemove
133 class HistoryItemRemove : public HistoryItem
136 typedef shared_ptr<HistoryItemRemove> Ptr;
138 HistoryItemRemove(FieldVector & fields);
139 virtual ~HistoryItemRemove()
148 /////////////////////////////////////////////////////////////////////
151 /////////////////////////////////////////////////////////////////////
153 // CLASS NAME: HistoryItemRepoAdd
155 class HistoryItemRepoAdd : public HistoryItem
158 typedef shared_ptr<HistoryItemRepoAdd> Ptr;
160 HistoryItemRepoAdd(FieldVector & fields);
161 virtual ~HistoryItemRepoAdd()
168 /////////////////////////////////////////////////////////////////////
171 /////////////////////////////////////////////////////////////////////
173 // CLASS NAME: HistoryItemRepoRemove
175 class HistoryItemRepoRemove : public HistoryItem
178 typedef shared_ptr<HistoryItemRepoRemove> Ptr;
180 HistoryItemRepoRemove(FieldVector & fields);
181 virtual ~HistoryItemRepoRemove()
187 /////////////////////////////////////////////////////////////////////
190 /////////////////////////////////////////////////////////////////////
192 // CLASS NAME: HistoryItemRepoAliasChange
194 class HistoryItemRepoAliasChange : public HistoryItem
197 typedef shared_ptr<HistoryItemRepoAliasChange> Ptr;
199 HistoryItemRepoAliasChange(FieldVector & fields);
200 virtual ~HistoryItemRepoAliasChange()
204 std::string oldalias;
205 std::string newalias;
207 /////////////////////////////////////////////////////////////////////
210 /////////////////////////////////////////////////////////////////////
212 // CLASS NAME: HistoryItemRepoUrlChange
214 class HistoryItemRepoUrlChange : public HistoryItem
217 typedef shared_ptr<HistoryItemRepoUrlChange> Ptr;
219 HistoryItemRepoUrlChange(FieldVector & fields);
220 virtual ~HistoryItemRepoUrlChange()
227 /////////////////////////////////////////////////////////////////////
232 #endif /* ZYPP_HISTORYLOGDATA_H_ */