libzypp  17.10.1
zypp::CountryCode Class Reference

Country codes (iso3166-1-alpha-2). More...

#include <CountryCode.h>

Inheritance diagram for zypp::CountryCode:

Public Member Functions

 CountryCode ()
 Default Ctor: noCode. More...
 
 CountryCode (IdString str_r)
 Ctor from string. More...
 
 CountryCode (const std::string &str_r)
 Ctor from string. More...
 
 CountryCode (const char *str_r)
 Ctor from string. More...
 
 ~CountryCode ()
 Dtor. More...
 
std::string code () const
 Return the country code asString. More...
 
std::string name () const
 Return the translated country name; if unknown the country code. More...
 
- Public Member Functions inherited from zypp::IdStringType< CountryCode >
IdString idStr () const
 
bool empty () const
 
unsigned size () const
 
const char * c_str () const
 
std::string asString () const
 
IdType id () const
 
 operator bool () const
 Evaluate in a boolean context ( ! empty() ). More...
 
 operator IdString () const
 Explicit conversion to IdString. More...
 
 operator std::string () const
 Explicit conversion to std::string. More...
 
int compare (const CountryCode &rhs) const
 
int compare (const IdStringType &rhs) const
 
int compare (const IdString &rhs) const
 
int compare (const std::string &rhs) const
 
int compare (const char *rhs) const
 

Static Public Attributes

CountryCode constants.
static const CountryCode noCode
 Empty code. More...
 

Private Attributes

IdString _str
 

Friends

class IdStringType< CountryCode >
 

Additional Inherited Members

- Public Types inherited from zypp::IdStringType< CountryCode >
typedef IdString::IdType IdType
 
- Static Public Member Functions inherited from zypp::IdStringType< CountryCode >
static int compare (const CountryCode &lhs, const CountryCode &rhs)
 
static int compare (const CountryCode &lhs, const IdString &rhs)
 
static int compare (const CountryCode &lhs, const std::string &rhs)
 
static int compare (const CountryCode &lhs, const char *rhs)
 
static int compare (const IdString &lhs, const CountryCode &rhs)
 
static int compare (const IdString &lhs, const IdString &rhs)
 
static int compare (const IdString &lhs, const std::string &rhs)
 
static int compare (const IdString &lhs, const char *rhs)
 
static int compare (const std::string &lhs, const CountryCode &rhs)
 
static int compare (const std::string &lhs, const IdString &rhs)
 
static int compare (const std::string &lhs, const std::string &rhs)
 
static int compare (const std::string &lhs, const char *rhs)
 
static int compare (const char *lhs, const CountryCode &rhs)
 
static int compare (const char *lhs, const IdString &rhs)
 
static int compare (const char *lhs, const std::string &rhs)
 
static int compare (const char *lhs, const char *rhs)
 
- Protected Member Functions inherited from zypp::IdStringType< CountryCode >
 IdStringType ()
 
 IdStringType (const IdStringType &)
 
void operator= (const IdStringType &)
 
 ~IdStringType ()
 
- Static Protected Member Functions inherited from zypp::sat::detail::PoolMember
static PoolImplmyPool ()
 

Detailed Description

Country codes (iso3166-1-alpha-2).

In fact the class will not prevent to use a non iso country code. Just a warning will appear in the log.

Definition at line 30 of file CountryCode.h.

Constructor & Destructor Documentation

◆ CountryCode() [1/4]

zypp::CountryCode::CountryCode ( )

Default Ctor: noCode.

Definition at line 120 of file CountryCode.cc.

◆ CountryCode() [2/4]

zypp::CountryCode::CountryCode ( IdString  str_r)
explicit

Ctor from string.

Definition at line 123 of file CountryCode.cc.

◆ CountryCode() [3/4]

zypp::CountryCode::CountryCode ( const std::string &  str_r)
explicit

Ctor from string.

Definition at line 127 of file CountryCode.cc.

◆ CountryCode() [4/4]

zypp::CountryCode::CountryCode ( const char *  str_r)
explicit

Ctor from string.

Definition at line 131 of file CountryCode.cc.

◆ ~CountryCode()

zypp::CountryCode::~CountryCode ( )

Dtor.

Definition at line 135 of file CountryCode.cc.

Member Function Documentation

◆ code()

std::string zypp::CountryCode::code ( ) const
inline

Return the country code asString.

Definition at line 58 of file CountryCode.h.

◆ name()

std::string zypp::CountryCode::name ( ) const

Return the translated country name; if unknown the country code.

Definition at line 139 of file CountryCode.cc.

Friends And Related Function Documentation

◆ IdStringType< CountryCode >

friend class IdStringType< CountryCode >
friend

Definition at line 65 of file CountryCode.h.

Member Data Documentation

◆ noCode

const CountryCode zypp::CountryCode::noCode
static

Empty code.

Definition at line 53 of file CountryCode.h.

◆ _str

IdString zypp::CountryCode::_str
private

Definition at line 66 of file CountryCode.h.


The documentation for this class was generated from the following files: