libzypp: zypp/CountryCode.h Source File

libzypp 17.38.11

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 ZYPP_API 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
52
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>;
66 IdString _str;
67 };
68} // namespace zypp
70
72
73 ZYPP_DEFINE_ID_HASHABLE( ::zypp::CountryCode );
74
75#endif // ZYPP_COUNTRYCODE_H
ZYPP_DEFINE_ID_HASHABLE
#define ZYPP_DEFINE_ID_HASHABLE(C)
Define hash function for id based classes.
Definition Hash.h:26
IdStringType.h
zypp::CountryCode
Country codes (iso3166-1-alpha-2).
Definition CountryCode.h:31
zypp::CountryCode::name
std::string name() const
Return the translated country name; if unknown the country code.
Definition CountryCode.cc:140
zypp::CountryCode::noCode
static const CountryCode noCode
Empty code.
Definition CountryCode.h:53
zypp::CountryCode::_str
IdString _str
Definition CountryCode.h:66
zypp::CountryCode::code
std::string code() const
Return the country code asString.
Definition CountryCode.h:58
zypp::CountryCode::CountryCode
CountryCode()
Default Ctor: noCode.
Definition CountryCode.cc:121
zypp::IdString
Access to the sat-pools string space.
Definition IdString.h:55
zypp::IdStringType< CountryCode >::IdStringType
IdStringType()=default
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
zypp::ZYPP_API
const Arch Arch_empty ZYPP_API
relates: Arch This is an empty Arch represented by an empty string.
Definition Arch.h:173