27 using parser::ParseException;
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);
44 HistoryActionID::HistoryActionID(
const std::string & strval_r)
45 : _id(parse(strval_r))
50 typedef std::map<std::string,ID> MapType;
62 _table[
"NONE"] = _table[
"none"] =
NONE_e;
65 MapType::const_iterator it = _table.find( strval_r );
66 if ( it != _table.end() )
69 WAR <<
"Unknown history action ID '" + strval_r +
"'" << endl;
76 typedef std::pair<std::string,std::string> PairType;
77 typedef std::map<ID, PairType> MapType;
82 _table[
INSTALL_e] = PairType(
"install" ,
"install" );
83 _table[
REMOVE_e] = PairType(
"remove" ,
"remove " );
84 _table[
REPO_ADD_e] = PairType(
"radd" ,
"radd " );
89 _table[
NONE_e] = PairType(
"NONE" ,
"NONE " );
92 return( pad ? _table[
_id].second : _table[
_id].first );
96 {
return str <<
id.asString(); }
140 if ( fields_r.size() < expect_r )
142 ZYPP_THROW( ParseException(
str::form(
"Bad number of fields. Got %zd, expected at least %zd.",
150 catch (
const std::exception & excpt )
170 : _pimpl( new
Impl( fields_r, expect_r ) )
174 : _pimpl( new
Impl( fields_r, expectedId_r, expect_r ) )
182 if ( fields_r.size() >= 2 )
187 #define OUTS(E,T) case HistoryActionID::E: return Ptr( new T( fields_r ) ); break;
219 static const std::string _empty;