libzypp 17.31.23
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
21namespace zypp
22{
30 class CountryCode : public IdStringType<CountryCode>
31 {
32 public:
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
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
Country codes (iso3166-1-alpha-2).
Definition: CountryCode.h:31
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
CountryCode()
Default Ctor: noCode.
Definition: CountryCode.cc:120
Base class for creating IdString based types.
Definition: IdStringType.h:87
Access to the sat-pools string space.
Definition: IdString.h:43
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
#define ZYPP_DEFINE_ID_HASHABLE(C)
Define hash function for id based classes.
Definition: Hash.h:26