libzypp 17.37.10

zypp::LanguageCode Class Reference

Language codes (iso639_2/iso639_1). More...

`#include <zypp/LanguageCode.h>`

Inheritance diagram for zypp::LanguageCode:

## Public Member Functions
| LanguageCode ()
| Default Ctor: noCode.
| LanguageCode (IdString str_r)
| Ctor from string.
| LanguageCode (const std::string &str_r)
| Ctor from string.
| LanguageCode (const char *str_r)
| Ctor from string.
| ~LanguageCode ()
| Dtor.
Public Member Functions inherited from zypp::IdStringType< LanguageCode >
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.

## LanguageCode constants.
static const LanguageCode | noCode
| Empty code.
static const LanguageCode | enCode
| Last resort "en".
class | IdStringType< LanguageCode >
IdString | _str
std::string | code () const
| Return the language code asString.
std::string | name () const
| Return the translated language name; if unknown the language code.

## Additional Inherited Members
Public Types inherited from zypp::IdStringType< LanguageCode >
using | IdType
Static Public Member Functions inherited from zypp::IdStringType< LanguageCode >
static int | compare (const LanguageCode &lhs, const LanguageCode &rhs)
Protected Member Functions inherited from zypp::IdStringType< LanguageCode >
| IdStringType ()=default
IdStringType & | operator= (const IdStringType &)=default
| ~IdStringType ()=default
Static Protected Member Functions inherited from zypp::sat::detail::PoolMember
static PoolImpl & | myPool ()
Related Symbols inherited from zypp::IdStringType< LanguageCode >
std::ostream & | operator<< (std::ostream &str, const IdStringType< LanguageCode > &obj)
| Stream output.
bool | operator== (const IdStringType< LanguageCode > &lhs, const IdStringType< LanguageCode > &rhs)
| Equal.
bool | operator!= (const IdStringType< LanguageCode > &lhs, const IdStringType< LanguageCode > &rhs)
| NotEqual.
bool | operator< (const IdStringType< LanguageCode > &lhs, const IdStringType< LanguageCode > &rhs)
| Less.
bool | operator<= (const IdStringType< LanguageCode > &lhs, const IdStringType< LanguageCode > &rhs)
| LessEqual.
bool | operator> (const IdStringType< LanguageCode > &lhs, const IdStringType< LanguageCode > &rhs)
| Greater.
bool | operator>= (const IdStringType< LanguageCode > &lhs, const IdStringType< LanguageCode > &rhs)
| GreaterEqual.

## Detailed Description

Language codes (iso639_2/iso639_1).

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

Definition at line 30 of file LanguageCode.h.

## Constructor & Destructor Documentation

## ◆ LanguageCode() [1/4]

zypp::LanguageCode::LanguageCode | ( |  | ) |

Default Ctor: noCode.

Definition at line 120 of file LanguageCode.cc.

## ◆ LanguageCode() [2/4]

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

Ctor from string.

Definition at line 123 of file LanguageCode.cc.

## ◆ LanguageCode() [3/4]

zypp::LanguageCode::LanguageCode | ( | const std::string & | str_r | ) |
| explicit

Ctor from string.

Definition at line 127 of file LanguageCode.cc.

## ◆ LanguageCode() [4/4]

zypp::LanguageCode::LanguageCode | ( | const char * | str_r | ) |
| explicit

Ctor from string.

Definition at line 131 of file LanguageCode.cc.

## ◆ ~LanguageCode()

zypp::LanguageCode::~LanguageCode | ( |  | ) |

Dtor.

Definition at line 135 of file LanguageCode.cc.

## Member Function Documentation

## ◆ code()

std::string zypp::LanguageCode::code | ( |  | ) | const
| inline

Return the language code asString.

Definition at line 59 of file LanguageCode.h.

## ◆ name()

std::string zypp::LanguageCode::name | ( |  | ) | const

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

Definition at line 139 of file LanguageCode.cc.

## Friends And Related Symbol Documentation

## ◆ IdStringType< LanguageCode >

friend class IdStringType< LanguageCode >
| friend

Definition at line 63 of file LanguageCode.h.

## Member Data Documentation

## ◆ noCode

const LanguageCode zypp::LanguageCode::noCode
| static

Empty code.

Definition at line 52 of file LanguageCode.h.

## ◆ enCode

const LanguageCode zypp::LanguageCode::enCode
| static

Last resort "en".

Definition at line 54 of file LanguageCode.h.

## ◆ _str

IdString zypp::LanguageCode::_str
| private

Definition at line 67 of file LanguageCode.h.

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

- zypp/LanguageCode.h
- zypp/LanguageCode.cc
- zypp/Locale.cc