libzypp  15.28.6
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
Access to the sat-pools string space.
Definition: IdString.h:41
Base class for creating IdString based types.
Definition: IdStringType.h:86
CountryCode()
Default Ctor: noCode.
Definition: CountryCode.cc:120
ZYPP_DEFINE_ID_HASHABLE(::zypp::CountryCode)
std::string name() const
Return the translated country name; if unknown the country code.
Definition: CountryCode.cc:139
static const CountryCode noCode
Empty code.
Definition: CountryCode.h:53
std::string code() const
Return the country code asString.
Definition: CountryCode.h:58
Country codes (iso3166-1-alpha-2).
Definition: CountryCode.h:30