libzypp: zypp::CountryCode Class Reference

libzypp 17.38.15

zypp::CountryCode Class Reference

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

`#include <zypp/CountryCode.h>`

Inheritance diagram for zypp::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.

## 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)
Protected Member Functions inherited from zypp::IdStringType< CountryCode >
| IdStringType ()=default
IdStringType & | operator= (const IdStringType &)=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]

zypp::CountryCode::CountryCode | ( |  | ) |

Default Ctor: noCode.

Definition at line 121 of file CountryCode.cc.

## ◆ CountryCode() [2/4]

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

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()

zypp::CountryCode::~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.

## Friends And Related Symbol Documentation

## ◆ IdStringType< CountryCode >

friend class IdStringType< CountryCode >
| friend

Definition at line 62 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:

- zypp/CountryCode.h
- zypp/CountryCode.cc