libzypp 17.38.6
zyppng::CountryCode Class Reference

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

#include <zypp/CountryCode.h>

Inheritance diagram for zyppng::CountryCode:

Public Member Functions

 CountryCode ()
 Default Ctor: noCode.
 CountryCode (IdString str_r)
 Ctor from string.
 CountryCode (const std::string &str_r)
 Ctor from string.
 CountryCode (const char *str_r)
 Ctor from string.
 ~CountryCode ()
 Dtor.
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 ( !
 operator IdString () const
 Explicit conversion to IdString.
 operator std::string () const
 Explicit conversion to std::string.
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

CountryCode constants.

static const CountryCode noCode
 Empty code.
class IdStringType< CountryCode >
IdString _str
std::string code () const
 Return the country code asString.
std::string name () const
 Return the translated country name; if unknown the country code.

Additional Inherited Members

Public Types inherited from zypp::IdStringType< CountryCode >
using 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 ()=default
 IdStringType (const IdStringType &)=default
 IdStringType (IdStringType &&) noexcept=default
IdStringTypeoperator= (const IdStringType &)=default
IdStringTypeoperator= (IdStringType &&) noexcept=default
 ~IdStringType ()=default

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]

Default Ctor: noCode.

Definition at line 121 of file CountryCode.cc.

◆ CountryCode() [2/4]

Ctor from string.

Definition at line 124 of file CountryCode.cc.

◆ CountryCode() [3/4]

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

Ctor from string.

Definition at line 128 of file CountryCode.cc.

◆ CountryCode() [4/4]

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

Ctor from string.

Definition at line 132 of file CountryCode.cc.

◆ ~CountryCode()

Dtor.

Definition at line 136 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 140 of file CountryCode.cc.

◆ IdStringType< CountryCode >

friend class IdStringType< CountryCode >
friend

Definition at line 62 of file CountryCode.h.

Member Data Documentation

◆ noCode

Empty code.

Definition at line 53 of file CountryCode.h.

◆ _str

Definition at line 66 of file CountryCode.h.


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