1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
12 #include "zypp/repo/RepoException.h"
20 static std::map<std::string,RepoType::Type> _table;
22 const RepoType RepoType::RPMMD(RepoType::RPMMD_e);
23 const RepoType RepoType::YAST2(RepoType::YAST2_e);
24 const RepoType RepoType::RPMPLAINDIR(RepoType::RPMPLAINDIR_e);
25 const RepoType RepoType::NONE(RepoType::NONE_e);
27 RepoType::RepoType(const std::string & strval_r)
28 : _type(parse(strval_r))
31 RepoType::Type RepoType::parse(const std::string & strval_r)
55 = RepoType::RPMPLAINDIR_e;
62 std::map<std::string,RepoType::Type>::const_iterator it
63 = _table.find(strval_r);
64 if (it == _table.end())
66 ZYPP_THROW(RepoUnknownTypeException(
67 "Unknown repository type '" + strval_r + "'"));
73 const std::string & RepoType::asString() const
75 static std::map<Type, std::string> _table;
79 _table[RPMMD_e] = "rpm-md";
80 _table[YAST2_e] = "yast2";
81 _table[RPMPLAINDIR_e] = "plaindir";
82 _table[NONE_e] = "NONE";
91 // vim: set ts=2 sts=2 sw=2 et ai: