libzypp: zypp/HistoryLogData.cc Source File

libzypp 17.38.14

HistoryLogData.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
9
13#include <sstream>
14
15#include <zypp-core/base/PtrTypes.h>
16#include <zypp-core/base/String.h>
17#include <zypp-core/base/Logger.h>
18#include <zypp-core/parser/ParseException>
19
20#include <zypp/HistoryLogData.h>
21
22using std::endl;
23
25namespace zypp
26{
27 using parser::ParseException;
28
30 //
31 // class HistoryActionID
32 //
34
35 const HistoryActionID HistoryActionID::NONE (HistoryActionID::NONE_e);
36 const HistoryActionID HistoryActionID::INSTALL (HistoryActionID::INSTALL_e);
37 const HistoryActionID HistoryActionID::REMOVE (HistoryActionID::REMOVE_e);
38 const HistoryActionID HistoryActionID::REPO_ADD (HistoryActionID::REPO_ADD_e);
39 const HistoryActionID HistoryActionID::REPO_REMOVE (HistoryActionID::REPO_REMOVE_e);
40 const HistoryActionID HistoryActionID::REPO_CHANGE_ALIAS (HistoryActionID::REPO_CHANGE_ALIAS_e);
41 const HistoryActionID HistoryActionID::REPO_CHANGE_URL (HistoryActionID::REPO_CHANGE_URL_e);
42 const HistoryActionID HistoryActionID::STAMP_COMMAND (HistoryActionID::STAMP_COMMAND_e);
43 const HistoryActionID HistoryActionID::PATCH_STATE_CHANGE (HistoryActionID::PATCH_STATE_CHANGE_e);
44
45 HistoryActionID::HistoryActionID(const std::string & strval_r)
46 : _id(parse(strval_r))
47 {}
48
49 HistoryActionID::ID HistoryActionID::parse( const std::string & strval_r )
50 {
51 typedef std::map<std::string,ID> MapType;
52 static MapType _table;
53 if ( _table.empty() )
54 {
55 // initialize it
56 _table["install"] = INSTALL_e;
57 _table["remove"] = REMOVE_e;
58 _table["radd"] = REPO_ADD_e;
59 _table["rremove"] = REPO_REMOVE_e;
60 _table["ralias"] = REPO_CHANGE_ALIAS_e;
61 _table["rurl"] = REPO_CHANGE_URL_e;
62 _table["command"] = STAMP_COMMAND_e;
63 _table["patch"] = PATCH_STATE_CHANGE_e;
64 _table["NONE"] = _table["none"] = NONE_e;
65 }
66
67 MapType::const_iterator it = _table.find( strval_r );
68 if ( it != _table.end() )
69 return it->second;
70 // else:
71 WAR << "Unknown history action ID '" + strval_r + "'" << endl;
72 return NONE_e;
73 }
74
75
76 const std::string & HistoryActionID::asString( bool pad ) const
77 {
78 typedef std::pair<std::string,std::string> PairType;
79 typedef std::map<ID, PairType> MapType;
80 static MapType _table;
81 if ( _table.empty() )
82 {
83 // initialize it pad(7) (for now)
84 _table[INSTALL_e] = PairType( "install" , "install" );
85 _table[REMOVE_e] = PairType( "remove" , "remove " );
86 _table[REPO_ADD_e] = PairType( "radd" , "radd " );
87 _table[REPO_REMOVE_e] = PairType( "rremove" , "rremove" );
88 _table[REPO_CHANGE_ALIAS_e] = PairType( "ralias" , "ralias " );
89 _table[REPO_CHANGE_URL_e] = PairType( "rurl" , "rurl " );
90 _table[STAMP_COMMAND_e] = PairType( "command" , "command" );
91 _table[PATCH_STATE_CHANGE_e]= PairType( "patch" , "patch " );
92 _table[NONE_e] = PairType( "NONE" , "NONE " );
93 }
94
95 return( pad ? _table[_id].second : _table[_id].first );
96 }
97
98 std::ostream & operator << (std::ostream & str, const HistoryActionID & id)
99 { return str << id.asString(); }
100
102
104 //
105 // class HistoryLogData::Impl
106 //
108 class HistoryLogData::Impl
109 {
110 public:
111 Impl( FieldVector & fields_r, size_type expect_r )
112 {
113 _checkFields( fields_r, expect_r );
114 _field.swap( fields_r );
115 // For whatever reason writer is ' '-padding the action field
116 // but we don't want to modify the vector before we moved it.
117 _field[ACTION_INDEX] = str::trim( _field[ACTION_INDEX] );
118 _action = HistoryActionID( _field[ACTION_INDEX] );
119 }
120
121 Impl( FieldVector & fields_r, HistoryActionID action_r, size_type expect_r )
122 {
123 _checkFields( fields_r, expect_r );
124 // For whatever reason writer is ' '-padding the action field
125 // but we don't want to modify the vector before we moved it.
126 std::string trimmed( str::trim( fields_r[ACTION_INDEX] ) );
127 _action = HistoryActionID( trimmed );
128 if ( _action != action_r )
129 {
130 ZYPP_THROW( ParseException( str::form( "Bad action id. Got %s, expected %s.",
131 _action.asString().c_str(),
132 action_r.asString().c_str() ) ) );
133 }
134 _field.swap( fields_r );
135 // now adjust action field:
136 _field[ACTION_INDEX] = trimmed;
137 }
138
139 void _checkFields( const FieldVector & fields_r, size_type expect_r )
140 {
141 if ( expect_r < 2 ) // at least 2 fields (date and action) are required
142 expect_r = 2;
143 if ( fields_r.size() < expect_r )
144 {
145 ZYPP_THROW( ParseException( str::form( "Bad number of fields. Got %zd, expected at least %zd.",
146 fields_r.size(),
147 expect_r ) ) );
148 }
149 try
150 {
151 _date = Date( fields_r[DATE_INDEX], HISTORY_LOG_DATE_FORMAT );
152 }
153 catch ( const std::exception & excpt )
154 {
155 ZYPP_THROW( ParseException( excpt.what() ) ); // invalid date format
156 }
157 // _action handled later
158 }
159
160 public:
161 FieldVector _field;
162 Date _date;
163 HistoryActionID _action;
164 };
165
167 //
168 // class HistoryLogData
169 //
171
172 HistoryLogData::HistoryLogData( FieldVector & fields_r, size_type expect_r )
173 : _pimpl( new Impl( fields_r, expect_r ) )
174 {}
175
176 HistoryLogData::HistoryLogData( FieldVector & fields_r, HistoryActionID expectedId_r, size_type expect_r )
177 : _pimpl( new Impl( fields_r, expectedId_r, expect_r ) )
178 {}
179
180 HistoryLogData::~HistoryLogData()
181 {}
182
183 HistoryLogData::Ptr HistoryLogData::create( FieldVector & fields_r )
184 {
185 if ( fields_r.size() >= 2 )
186 {
187 // str::trim( _field[ACTION_INDEX] );
188 switch ( HistoryActionID( str::trim( fields_r[ACTION_INDEX] ) ).toEnum() )
189 {
190#define OUTS(E,T) case HistoryActionID::E: return Ptr( new T( fields_r ) ); break;
191 OUTS( INSTALL_e, HistoryLogDataInstall );
192 OUTS( REMOVE_e, HistoryLogDataRemove );
193 OUTS( REPO_ADD_e, HistoryLogDataRepoAdd );
194 OUTS( REPO_REMOVE_e, HistoryLogDataRepoRemove );
195 OUTS( REPO_CHANGE_ALIAS_e, HistoryLogDataRepoAliasChange );
196 OUTS( REPO_CHANGE_URL_e, HistoryLogDataRepoUrlChange );
197 OUTS( STAMP_COMMAND_e, HistoryLogDataStampCommand );
198 OUTS( PATCH_STATE_CHANGE_e, HistoryLogPatchStateChange );
199#undef OUTS
200 // intentionally no default:
201 case HistoryActionID::NONE_e:
202 break;
203 }
204 }
205 // unknown action or invalid fields? Ctor will accept or throw.
206 return Ptr( new HistoryLogData( fields_r ) );
207 }
208
209 bool HistoryLogData::empty() const
210 { return _pimpl->_field.empty(); }
211
212 HistoryLogData::size_type HistoryLogData::size() const
213 { return _pimpl->_field.size(); }
214
215 HistoryLogData::const_iterator HistoryLogData::begin() const
216 { return _pimpl->_field.begin(); }
217
218 HistoryLogData::const_iterator HistoryLogData::end() const
219 { return _pimpl->_field.end(); }
220
221 const std::string & HistoryLogData::optionalAt( size_type idx_r ) const
222 {
223 static const std::string _empty;
224 return( idx_r < size() ? _pimpl->_field[idx_r] : _empty );
225 }
226
227 const std::string & HistoryLogData::at( size_type idx_r ) const
228 { return _pimpl->_field.at( idx_r ); }
229
230
231 Date HistoryLogData::date() const
232 { return _pimpl->_date; }
233
234 HistoryActionID HistoryLogData::action() const
235 { return _pimpl->_action; }
236
237
238 std::ostream & operator<<( std::ostream & str, const HistoryLogData & obj )
239 { return str << str::joinEscaped( obj.begin(), obj.end(), '|' ); }
240
242 // class HistoryLogDataInstall
244 HistoryLogDataInstall::HistoryLogDataInstall( FieldVector & fields_r )
245 : HistoryLogData( fields_r )
246 {}
247 std::string HistoryLogDataInstall::name() const { return optionalAt( NAME_INDEX ); }
248 Edition HistoryLogDataInstall::edition() const { return Edition( optionalAt( EDITION_INDEX ) ); }
249 Arch HistoryLogDataInstall::arch() const { return Arch( optionalAt( ARCH_INDEX ) ); }
250 std::string HistoryLogDataInstall::reqby() const { return optionalAt( REQBY_INDEX ); }
251 std::string HistoryLogDataInstall::repoAlias() const { return optionalAt( REPOALIAS_INDEX ); }
252 CheckSum HistoryLogDataInstall::checksum() const { return optionalAt( CHEKSUM_INDEX ); }
253 std::string HistoryLogDataInstall::userdata() const { return optionalAt( USERDATA_INDEX ); }
254
256 // class HistoryLogPatchStateChange
258 HistoryLogPatchStateChange::HistoryLogPatchStateChange( FieldVector & fields_r )
259 : HistoryLogData( fields_r )
260 {}
261 std::string HistoryLogPatchStateChange::name() const { return optionalAt( NAME_INDEX ); }
262 Edition HistoryLogPatchStateChange::edition() const { return Edition( optionalAt( EDITION_INDEX ) ); }
263 Arch HistoryLogPatchStateChange::arch() const { return Arch( optionalAt( ARCH_INDEX ) ); }
264 std::string HistoryLogPatchStateChange::repoAlias() const { return optionalAt( REPOALIAS_INDEX ); }
265 Patch::SeverityFlag HistoryLogPatchStateChange::severity() const { return Patch::severityFlag( optionalAt( SEVERITY_INDEX ) ); }
266 Patch::Category HistoryLogPatchStateChange::category() const { return Patch::categoryEnum( optionalAt( CATEGORY_INDEX ) ); }
267 std::string HistoryLogPatchStateChange::oldstate() const { return optionalAt( OLDSTATE_INDEX ); }
268 std::string HistoryLogPatchStateChange::newstate() const { return optionalAt( NEWSTATE_INDEX ); }
269 std::string HistoryLogPatchStateChange::userdata() const { return optionalAt( USERDATA_INDEX ); }
270
272 // class HistoryLogDataRemove
274 HistoryLogDataRemove::HistoryLogDataRemove( FieldVector & fields_r )
275 : HistoryLogData( fields_r )
276 {}
277 std::string HistoryLogDataRemove::name() const { return optionalAt( NAME_INDEX ); }
278 Edition HistoryLogDataRemove::edition() const { return Edition( optionalAt( EDITION_INDEX ) ); }
279 Arch HistoryLogDataRemove::arch() const { return Arch( optionalAt( ARCH_INDEX ) ); }
280 std::string HistoryLogDataRemove::reqby() const { return optionalAt( REQBY_INDEX ); }
281 std::string HistoryLogDataRemove::userdata() const { return optionalAt( USERDATA_INDEX ); }
282
284 // class HistoryLogDataRepoAdd
286 HistoryLogDataRepoAdd::HistoryLogDataRepoAdd( FieldVector & fields_r )
287 : HistoryLogData( fields_r )
288 {}
289 std::string HistoryLogDataRepoAdd::alias() const { return optionalAt( ALIAS_INDEX ); }
290 Url HistoryLogDataRepoAdd::url() const { return optionalAt( URL_INDEX ); }
291 std::string HistoryLogDataRepoAdd::userdata() const { return optionalAt( USERDATA_INDEX ); }
292
294 // class HistoryLogDataRepoRemove
296 HistoryLogDataRepoRemove::HistoryLogDataRepoRemove( FieldVector & fields_r )
297 : HistoryLogData( fields_r )
298 {}
299 std::string HistoryLogDataRepoRemove::alias() const { return optionalAt( ALIAS_INDEX ); }
300 std::string HistoryLogDataRepoRemove::userdata() const { return optionalAt( USERDATA_INDEX ); }
301
303 // class HistoryLogDataRepoAliasChange
305 HistoryLogDataRepoAliasChange::HistoryLogDataRepoAliasChange( FieldVector & fields_r )
306 : HistoryLogData( fields_r )
307 {}
308 std::string HistoryLogDataRepoAliasChange::oldAlias() const { return optionalAt( OLDALIAS_INDEX ); }
309 std::string HistoryLogDataRepoAliasChange::newAlias() const { return optionalAt( NEWALIAS_INDEX ); }
310 std::string HistoryLogDataRepoAliasChange::userdata() const { return optionalAt( USERDATA_INDEX ); }
311
313 // class HistoryLogDataRepoUrlChange
315 HistoryLogDataRepoUrlChange::HistoryLogDataRepoUrlChange( FieldVector & fields_r )
316 : HistoryLogData( fields_r )
317 {}
318 std::string HistoryLogDataRepoUrlChange::alias() const { return optionalAt( ALIAS_INDEX ); }
319 Url HistoryLogDataRepoUrlChange::newUrl() const { return optionalAt( NEWURL_INDEX ); }
320 std::string HistoryLogDataRepoUrlChange::userdata() const { return optionalAt( USERDATA_INDEX ); }
321
323 // class HistoryLogDataStampCommand
325 HistoryLogDataStampCommand::HistoryLogDataStampCommand( FieldVector & fields_r )
326 : HistoryLogData( fields_r )
327 {}
328 std::string HistoryLogDataStampCommand::executedBy() const { return optionalAt( USER_INDEX ); }
329 std::string HistoryLogDataStampCommand::command() const { return optionalAt( COMMAND_INDEX ); }
330 std::string HistoryLogDataStampCommand::userdata() const { return optionalAt( USERDATA_INDEX ); }
331
332} // namespace zypp
OUTS
#define OUTS(VAL)
ZYPP_THROW
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
Definition Exception.h:459
HistoryLogData.h
HISTORY_LOG_DATE_FORMAT
#define HISTORY_LOG_DATE_FORMAT
Definition HistoryLogData.h:26
Logger.h
WAR
#define WAR
Definition Logger.h:104
PtrTypes.h
String.h
zypp::Arch
Architecture.
Definition Arch.h:37
zypp::Arch::Arch
Arch()
Default ctor Arc_noarch.
Definition Arch.cc:681
zypp::CheckSum
Definition CheckSum.h:34
zypp::Date
Store and operate on date (time_t).
Definition Date.h:33
zypp::Date::Date
Date()
Default ctor: 0.
Definition Date.h:57
zypp::Edition
Edition represents [epoch:]version[-release].
Definition Edition.h:60
zypp::Edition::Edition
Edition()
Default ctor: noedition.
Definition Edition.h:76
zypp::HistoryLogDataInstall
A zypp history log line for an installed packaged.
Definition HistoryLogData.h:200
zypp::HistoryLogDataInstall::HistoryLogDataInstall
HistoryLogDataInstall(FieldVector &fields_r)
Ctor moving FieldVector (via swap).
Definition HistoryLogData.cc:244
zypp::HistoryLogDataInstall::userdata
std::string userdata() const
userdata/transactionID
Definition HistoryLogData.cc:253
zypp::HistoryLogDataInstall::EDITION_INDEX
@ EDITION_INDEX
package edition
Definition HistoryLogData.h:215
zypp::HistoryLogDataInstall::REQBY_INDEX
@ REQBY_INDEX
requested by (user@hostname, pid:appname, or empty (solver))
Definition HistoryLogData.h:217
zypp::HistoryLogDataInstall::ARCH_INDEX
@ ARCH_INDEX
package architecture
Definition HistoryLogData.h:216
zypp::HistoryLogDataInstall::USERDATA_INDEX
@ USERDATA_INDEX
userdata/transactionID
Definition HistoryLogData.h:220
zypp::HistoryLogDataInstall::REPOALIAS_INDEX
@ REPOALIAS_INDEX
repository providing the package
Definition HistoryLogData.h:218
zypp::HistoryLogDataInstall::CHEKSUM_INDEX
@ CHEKSUM_INDEX
package checksum
Definition HistoryLogData.h:219
zypp::HistoryLogDataInstall::NAME_INDEX
@ NAME_INDEX
package name
Definition HistoryLogData.h:214
zypp::HistoryLogDataInstall::checksum
CheckSum checksum() const
package checksum
Definition HistoryLogData.cc:252
zypp::HistoryLogDataInstall::name
std::string name() const
package name
Definition HistoryLogData.cc:247
zypp::HistoryLogDataInstall::arch
Arch arch() const
package architecture
Definition HistoryLogData.cc:249
zypp::HistoryLogDataInstall::reqby
std::string reqby() const
requested by (user@hostname, pid:appname, or empty (solver))
Definition HistoryLogData.cc:250
zypp::HistoryLogDataInstall::repoAlias
std::string repoAlias() const
repository providing the package
Definition HistoryLogData.cc:251
zypp::HistoryLogDataInstall::edition
Edition edition() const
package edition
Definition HistoryLogData.cc:248
zypp::HistoryLogDataRemove
A zypp history log line for a removed packge.
Definition HistoryLogData.h:284
zypp::HistoryLogDataRemove::arch
Arch arch() const
package architecture
Definition HistoryLogData.cc:279
zypp::HistoryLogDataRemove::NAME_INDEX
@ NAME_INDEX
package name
Definition HistoryLogData.h:298
zypp::HistoryLogDataRemove::REQBY_INDEX
@ REQBY_INDEX
requested by (user@hostname, pid:appname, or empty (solver))
Definition HistoryLogData.h:301
zypp::HistoryLogDataRemove::ARCH_INDEX
@ ARCH_INDEX
package architecture
Definition HistoryLogData.h:300
zypp::HistoryLogDataRemove::USERDATA_INDEX
@ USERDATA_INDEX
userdata/transactionID
Definition HistoryLogData.h:302
zypp::HistoryLogDataRemove::EDITION_INDEX
@ EDITION_INDEX
package edition
Definition HistoryLogData.h:299
zypp::HistoryLogDataRemove::HistoryLogDataRemove
HistoryLogDataRemove(FieldVector &fields_r)
Ctor moving FieldVector (via swap).
Definition HistoryLogData.cc:274
zypp::HistoryLogDataRemove::edition
Edition edition() const
package edition
Definition HistoryLogData.cc:278
zypp::HistoryLogDataRemove::name
std::string name() const
package name
Definition HistoryLogData.cc:277
zypp::HistoryLogDataRemove::userdata
std::string userdata() const
userdata/transactionID
Definition HistoryLogData.cc:281
zypp::HistoryLogDataRemove::reqby
std::string reqby() const
requested by (user@hostname, pid:appname, or empty (solver))
Definition HistoryLogData.cc:280
zypp::HistoryLogDataRepoAdd
A zypp history log line for an added repository.
Definition HistoryLogData.h:319
zypp::HistoryLogDataRepoAdd::URL_INDEX
@ URL_INDEX
repository url
Definition HistoryLogData.h:334
zypp::HistoryLogDataRepoAdd::ALIAS_INDEX
@ ALIAS_INDEX
repository alias
Definition HistoryLogData.h:333
zypp::HistoryLogDataRepoAdd::USERDATA_INDEX
@ USERDATA_INDEX
userdata/transactionID
Definition HistoryLogData.h:335
zypp::HistoryLogDataRepoAdd::alias
std::string alias() const
repository alias
Definition HistoryLogData.cc:289
zypp::HistoryLogDataRepoAdd::url
Url url() const
repository url
Definition HistoryLogData.cc:290
zypp::HistoryLogDataRepoAdd::HistoryLogDataRepoAdd
HistoryLogDataRepoAdd(FieldVector &fields_r)
Ctor moving FieldVector (via swap).
Definition HistoryLogData.cc:286
zypp::HistoryLogDataRepoAdd::userdata
std::string userdata() const
userdata/transactionID
Definition HistoryLogData.cc:291
zypp::HistoryLogDataRepoAliasChange
A zypp history log line for a repo alias change.
Definition HistoryLogData.h:379
zypp::HistoryLogDataRepoAliasChange::userdata
std::string userdata() const
userdata/transactionID
Definition HistoryLogData.cc:310
zypp::HistoryLogDataRepoAliasChange::oldAlias
std::string oldAlias() const
repositories old alias
Definition HistoryLogData.cc:308
zypp::HistoryLogDataRepoAliasChange::NEWALIAS_INDEX
@ NEWALIAS_INDEX
repositories new alias
Definition HistoryLogData.h:394
zypp::HistoryLogDataRepoAliasChange::USERDATA_INDEX
@ USERDATA_INDEX
userdata/transactionID
Definition HistoryLogData.h:395
zypp::HistoryLogDataRepoAliasChange::OLDALIAS_INDEX
@ OLDALIAS_INDEX
repositories old alias
Definition HistoryLogData.h:393
zypp::HistoryLogDataRepoAliasChange::newAlias
std::string newAlias() const
repositories new alias
Definition HistoryLogData.cc:309
zypp::HistoryLogDataRepoAliasChange::HistoryLogDataRepoAliasChange
HistoryLogDataRepoAliasChange(FieldVector &fields_r)
Ctor moving FieldVector (via swap).
Definition HistoryLogData.cc:305
zypp::HistoryLogDataRepoRemove
A zypp history log line for a removed repository.
Definition HistoryLogData.h:350
zypp::HistoryLogDataRepoRemove::USERDATA_INDEX
@ USERDATA_INDEX
userdata/transactionID
Definition HistoryLogData.h:365
zypp::HistoryLogDataRepoRemove::ALIAS_INDEX
@ ALIAS_INDEX
repository alias
Definition HistoryLogData.h:364
zypp::HistoryLogDataRepoRemove::HistoryLogDataRepoRemove
HistoryLogDataRepoRemove(FieldVector &fields_r)
Ctor moving FieldVector (via swap).
Definition HistoryLogData.cc:296
zypp::HistoryLogDataRepoRemove::alias
std::string alias() const
repository alias
Definition HistoryLogData.cc:299
zypp::HistoryLogDataRepoRemove::userdata
std::string userdata() const
userdata/transactionID
Definition HistoryLogData.cc:300
zypp::HistoryLogDataRepoUrlChange
A zypp history log line for a repo url change.
Definition HistoryLogData.h:410
zypp::HistoryLogDataRepoUrlChange::newUrl
Url newUrl() const
repositories new url
Definition HistoryLogData.cc:319
zypp::HistoryLogDataRepoUrlChange::alias
std::string alias() const
repository alias
Definition HistoryLogData.cc:318
zypp::HistoryLogDataRepoUrlChange::NEWURL_INDEX
@ NEWURL_INDEX
repositories new url
Definition HistoryLogData.h:425
zypp::HistoryLogDataRepoUrlChange::USERDATA_INDEX
@ USERDATA_INDEX
userdata/transactionID
Definition HistoryLogData.h:426
zypp::HistoryLogDataRepoUrlChange::ALIAS_INDEX
@ ALIAS_INDEX
repository alias
Definition HistoryLogData.h:424
zypp::HistoryLogDataRepoUrlChange::userdata
std::string userdata() const
userdata/transactionID
Definition HistoryLogData.cc:320
zypp::HistoryLogDataRepoUrlChange::HistoryLogDataRepoUrlChange
HistoryLogDataRepoUrlChange(FieldVector &fields_r)
Ctor moving FieldVector (via swap).
Definition HistoryLogData.cc:315
zypp::HistoryLogDataStampCommand
A zypp history log line identifying the program that triggered the following commit.
Definition HistoryLogData.h:442
zypp::HistoryLogDataStampCommand::command
std::string command() const
the commandline executed
Definition HistoryLogData.cc:329
zypp::HistoryLogDataStampCommand::executedBy
std::string executedBy() const
executed by user@hostname
Definition HistoryLogData.cc:328
zypp::HistoryLogDataStampCommand::HistoryLogDataStampCommand
HistoryLogDataStampCommand(FieldVector &fields_r)
Ctor moving FieldVector (via swap).
Definition HistoryLogData.cc:325
zypp::HistoryLogDataStampCommand::COMMAND_INDEX
@ COMMAND_INDEX
the commandline executed
Definition HistoryLogData.h:457
zypp::HistoryLogDataStampCommand::USER_INDEX
@ USER_INDEX
executed by user@hostname
Definition HistoryLogData.h:456
zypp::HistoryLogDataStampCommand::USERDATA_INDEX
@ USERDATA_INDEX
userdata/transactionID
Definition HistoryLogData.h:458
zypp::HistoryLogDataStampCommand::userdata
std::string userdata() const
userdata/transactionID
Definition HistoryLogData.cc:330
zypp::HistoryLogData::Impl
Definition HistoryLogData.cc:109
zypp::HistoryLogData::Impl::_field
FieldVector _field
Definition HistoryLogData.cc:161
zypp::HistoryLogData::Impl::_action
HistoryActionID _action
Definition HistoryLogData.cc:163
zypp::HistoryLogData::Impl::Impl
Impl(FieldVector &fields_r, size_type expect_r)
Definition HistoryLogData.cc:111
zypp::HistoryLogData::Impl::_checkFields
void _checkFields(const FieldVector &fields_r, size_type expect_r)
Definition HistoryLogData.cc:139
zypp::HistoryLogData::Impl::Impl
Impl(FieldVector &fields_r, HistoryActionID action_r, size_type expect_r)
Definition HistoryLogData.cc:121
zypp::HistoryLogData::Impl::_date
Date _date
Definition HistoryLogData.cc:162
zypp::HistoryLogData
A zypp history log line split into fields.
Definition HistoryLogData.h:106
zypp::HistoryLogData::action
HistoryActionID action() const
HistoryActionID (or NONE_e if unknown).
Definition HistoryLogData.cc:234
zypp::HistoryLogData::create
static Ptr create(FieldVector &fields_r)
Factory method creating HistoryLogData classes.
Definition HistoryLogData.cc:183
zypp::HistoryLogData::end
const_iterator end() const
Iterator pointing behind the last element in vector.
Definition HistoryLogData.cc:218
zypp::HistoryLogData::~HistoryLogData
virtual ~HistoryLogData()
Dtor.
Definition HistoryLogData.cc:180
zypp::HistoryLogData::FieldVector
std::vector< std::string > FieldVector
Definition HistoryLogData.h:111
zypp::HistoryLogData::at
const std::string & at(size_type idx_r) const
Access (required) field by number.
Definition HistoryLogData.cc:227
zypp::HistoryLogData::const_iterator
FieldVector::const_iterator const_iterator
Definition HistoryLogData.h:113
zypp::HistoryLogData::optionalAt
const std::string & optionalAt(size_type idx_r) const
Access (optional) field by number.
Definition HistoryLogData.cc:221
zypp::HistoryLogData::begin
const_iterator begin() const
Iterator pointing to 1st element in vector (or end()).
Definition HistoryLogData.cc:215
zypp::HistoryLogData::size_type
FieldVector::size_type size_type
Definition HistoryLogData.h:112
zypp::HistoryLogData::ACTION_INDEX
@ ACTION_INDEX
HistoryActionID.
Definition HistoryLogData.h:175
zypp::HistoryLogData::DATE_INDEX
@ DATE_INDEX
date
Definition HistoryLogData.h:174
zypp::HistoryLogData::empty
bool empty() const
Whether FieldVector is empty.
Definition HistoryLogData.cc:209
zypp::HistoryLogData::date
Date date() const
date
Definition HistoryLogData.cc:231
zypp::HistoryLogData::_pimpl
RWCOW_pointer< Impl > _pimpl
Implementation class.
Definition HistoryLogData.h:185
zypp::HistoryLogData::HistoryLogData
HistoryLogData(FieldVector &fields_r, size_type expect_r=2)
Ctor moving FieldVector (via swap).
Definition HistoryLogData.cc:172
zypp::HistoryLogData::Ptr
shared_ptr< HistoryLogData > Ptr
Definition HistoryLogData.h:108
zypp::HistoryLogData::size
size_type size() const
Number of fields in vector.
Definition HistoryLogData.cc:212
zypp::HistoryLogPatchStateChange
A zypp history log line for an installed packaged.
Definition HistoryLogData.h:240
zypp::HistoryLogPatchStateChange::repoAlias
std::string repoAlias() const
repository providing the package
Definition HistoryLogData.cc:264
zypp::HistoryLogPatchStateChange::newstate
std::string newstate() const
Definition HistoryLogData.cc:268
zypp::HistoryLogPatchStateChange::name
std::string name() const
package name
Definition HistoryLogData.cc:261
zypp::HistoryLogPatchStateChange::userdata
std::string userdata() const
userdata/transactionID
Definition HistoryLogData.cc:269
zypp::HistoryLogPatchStateChange::category
Patch::Category category() const
Definition HistoryLogData.cc:266
zypp::HistoryLogPatchStateChange::arch
Arch arch() const
package architecture
Definition HistoryLogData.cc:263
zypp::HistoryLogPatchStateChange::OLDSTATE_INDEX
@ OLDSTATE_INDEX
the state of the patch before the change
Definition HistoryLogData.h:260
zypp::HistoryLogPatchStateChange::CATEGORY_INDEX
@ CATEGORY_INDEX
patch category
Definition HistoryLogData.h:259
zypp::HistoryLogPatchStateChange::EDITION_INDEX
@ EDITION_INDEX
patch edition
Definition HistoryLogData.h:255
zypp::HistoryLogPatchStateChange::NAME_INDEX
@ NAME_INDEX
patch name
Definition HistoryLogData.h:254
zypp::HistoryLogPatchStateChange::ARCH_INDEX
@ ARCH_INDEX
patch architecture
Definition HistoryLogData.h:256
zypp::HistoryLogPatchStateChange::NEWSTATE_INDEX
@ NEWSTATE_INDEX
the state of the patch after the change
Definition HistoryLogData.h:261
zypp::HistoryLogPatchStateChange::SEVERITY_INDEX
@ SEVERITY_INDEX
patch severity
Definition HistoryLogData.h:258
zypp::HistoryLogPatchStateChange::REPOALIAS_INDEX
@ REPOALIAS_INDEX
repository providing the patch
Definition HistoryLogData.h:257
zypp::HistoryLogPatchStateChange::USERDATA_INDEX
@ USERDATA_INDEX
userdata/transactionID
Definition HistoryLogData.h:262
zypp::HistoryLogPatchStateChange::edition
Edition edition() const
package edition
Definition HistoryLogData.cc:262
zypp::HistoryLogPatchStateChange::severity
Patch::SeverityFlag severity() const
Definition HistoryLogData.cc:265
zypp::HistoryLogPatchStateChange::oldstate
std::string oldstate() const
Definition HistoryLogData.cc:267
zypp::HistoryLogPatchStateChange::HistoryLogPatchStateChange
HistoryLogPatchStateChange(FieldVector &fields_r)
Ctor moving FieldVector (via swap).
Definition HistoryLogData.cc:258
zypp::ParseException::ParseException
ParseException()
Default ctor.
Definition parseexception.cc:29
zypp::Patch::categoryEnum
Category categoryEnum() const
This patch's category as enum of wellknown categories.
Definition Patch.cc:49
zypp::Patch::SeverityFlag
SeverityFlag
Possible severity levels for (security) patches.
Definition Patch.h:76
zypp::Patch::Category
Category
Definition Patch.h:48
zypp::Patch::severityFlag
SeverityFlag severityFlag() const
Severity string mapped to an enum.
Definition Patch.cc:142
zypp::Url
Url manipulation class.
Definition Url.h:93
zypp::parser::ParseException
Definition parseexception.h:34
str
String related utilities and Regular expression matching.
zypp::str::joinEscaped
std::string joinEscaped(TIterator begin, TIterator end, const char sep_r=' ')
Join strings using separator sep_r, quoting or escaping the values.
Definition String.h:868
zypp::str::form
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
Definition String.cc:39
zypp::str::trim
std::string trim(const std::string &s, const Trim trim_r)
Definition String.cc:226
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
zypp::operator<<
std::ostream & operator<<(std::ostream &str, const Capabilities &obj)
relates: Capabilities Stream output
Definition Capabilities.cc:65
zypp::HistoryActionID
Enumeration of known history actions.
Definition HistoryLogData.h:38
zypp::HistoryActionID::asString
const std::string & asString(bool pad=false) const
Definition HistoryLogData.cc:76
zypp::HistoryActionID::HistoryActionID
HistoryActionID()
Definition HistoryLogData.h:64
zypp::HistoryActionID::ID
ID
Definition HistoryLogData.h:51
zypp::HistoryActionID::PATCH_STATE_CHANGE_e
@ PATCH_STATE_CHANGE_e
Definition HistoryLogData.h:61
zypp::HistoryActionID::REPO_ADD_e
@ REPO_ADD_e
Definition HistoryLogData.h:56
zypp::HistoryActionID::NONE_e
@ NONE_e
Definition HistoryLogData.h:52
zypp::HistoryActionID::REMOVE_e
@ REMOVE_e
Definition HistoryLogData.h:55
zypp::HistoryActionID::STAMP_COMMAND_e
@ STAMP_COMMAND_e
Definition HistoryLogData.h:60
zypp::HistoryActionID::REPO_CHANGE_URL_e
@ REPO_CHANGE_URL_e
Definition HistoryLogData.h:59
zypp::HistoryActionID::REPO_REMOVE_e
@ REPO_REMOVE_e
Definition HistoryLogData.h:57
zypp::HistoryActionID::INSTALL_e
@ INSTALL_e
Definition HistoryLogData.h:54
zypp::HistoryActionID::REPO_CHANGE_ALIAS_e
@ REPO_CHANGE_ALIAS_e
Definition HistoryLogData.h:58
zypp::HistoryActionID::parse
static HistoryActionID::ID parse(const std::string &strval_r)
Definition HistoryLogData.cc:49
zypp::HistoryActionID::_id
ID _id
Definition HistoryLogData.h:77