libzypp  17.25.3
CountryCode.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_COUNTRYCODE_H
13 #define ZYPP_COUNTRYCODE_H
14 
15 #include <iosfwd>
16 #include <string>
17 
18 #include <zypp/IdStringType.h>
19 
21 namespace zypp
22 {
30  class CountryCode : public IdStringType<CountryCode>
31  {
32  public:
34  CountryCode();
35 
37  explicit CountryCode( IdString str_r );
38 
40  explicit CountryCode( const std::string & str_r );
41 
43  explicit CountryCode( const char * str_r );
44 
46  ~CountryCode();
47 
48  public:
49 
53  static const CountryCode noCode;
55 
56  public:
58  std::string code() const
59  { return std::string(_str); }
60 
62  std::string name() const;
63 
64  private:
65  friend class IdStringType<CountryCode>;
67  };
68 } // namespace zypp
70 
72 
74 
75 #endif // ZYPP_COUNTRYCODE_H
zypp::CountryCode::noCode
static const CountryCode noCode
Empty code.
Definition: CountryCode.h:53
zypp::CountryCode::code
std::string code() const
Return the country code asString.
Definition: CountryCode.h:58
zypp::IdStringType
Base class for creating IdString based types.
Definition: IdStringType.h:87
zypp::CountryCode::name
std::string name() const
Return the translated country name; if unknown the country code.
Definition: CountryCode.cc:139
zypp::CountryCode::_str
IdString _str
Definition: CountryCode.h:66
IdStringType.h
zypp::IdString
Access to the sat-pools string space.
Definition: IdString.h:43
ZYPP_DEFINE_ID_HASHABLE
ZYPP_DEFINE_ID_HASHABLE(::zypp::CountryCode)
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
zypp::CountryCode
Country codes (iso3166-1-alpha-2).
Definition: CountryCode.h:31
zypp::CountryCode::CountryCode
CountryCode()
Default Ctor: noCode.
Definition: CountryCode.cc:120
zypp::CountryCode::~CountryCode
~CountryCode()
Dtor.
Definition: CountryCode.cc:135