Container - Language

Container - Language — A container class for Language subtag

Synopsis

lt_bool_t           lt_lang_compare                     (const lt_lang_t *v1,
                                                         const lt_lang_t *v2);
void                lt_lang_dump                        (const lt_lang_t *lang);
const char *        lt_lang_get_better_tag              (const lt_lang_t *lang);
const char *        lt_lang_get_macro_language          (const lt_lang_t *lang);
const char *        lt_lang_get_name                    (const lt_lang_t *lang);
const char *        lt_lang_get_preferred_tag           (const lt_lang_t *lang);
const char *        lt_lang_get_scope                   (const lt_lang_t *lang);
const char *        lt_lang_get_suppress_script         (const lt_lang_t *lang);
const char *        lt_lang_get_tag                     (const lt_lang_t *lang);
lt_lang_t *         lt_lang_ref                         (lt_lang_t *lang);
                    lt_lang_t;
void                lt_lang_unref                       (lt_lang_t *lang);

Description

This container class provides a data access to Language subtag entry.

Details

lt_lang_compare ()

lt_bool_t           lt_lang_compare                     (const lt_lang_t *v1,
                                                         const lt_lang_t *v2);

Compare if v1 and v2 is the same object or not.

v1 :

a lt_lang_t.

v2 :

a lt_lang_t.

Returns :

TRUE if it's the same, otherwise FALSE.

lt_lang_dump ()

void                lt_lang_dump                        (const lt_lang_t *lang);

Dumps the container information to the standard output.

lang :

a lt_lang_t.

lt_lang_get_better_tag ()

const char *        lt_lang_get_better_tag              (const lt_lang_t *lang);

Obtains the better tag for use. this is a convenient function to get the preferred-value if available.

lang :

a lt_lang_t.

Returns :

a tag string.

lt_lang_get_macro_language ()

const char *        lt_lang_get_macro_language          (const lt_lang_t *lang);

Obtains the macrolanguage being assigned for the subtag. This is available only when the subtag is registered as the macrolanguage in ISO 639-3.

lang :

a lt_lang_t.

Returns :

a macrolanguage string or NULL.

lt_lang_get_name ()

const char *        lt_lang_get_name                    (const lt_lang_t *lang);

Obtains the description of the subtag.

lang :

a lt_lang_t.

Returns :

a description string.

lt_lang_get_preferred_tag ()

const char *        lt_lang_get_preferred_tag           (const lt_lang_t *lang);

Obtains the preferred-value. this is available only when the tag is marked as deprecated.

lang :

a lt_lang_t.

Returns :

a preferred-value for the tag or NULL.

lt_lang_get_scope ()

const char *        lt_lang_get_scope                   (const lt_lang_t *lang);

Obtains the scope value indicating the type of language code according to ISO 639.

lang :

a lt_lang_t.

Returns :

a scope string or NULL.

lt_lang_get_suppress_script ()

const char *        lt_lang_get_suppress_script         (const lt_lang_t *lang);

Obtains the suppress-script value. which shouldn't be used to form language tags with the associated primary or extended language subtag.

lang :

a lt_lang_t.

Returns :

a suppress-script string or NULL.

lt_lang_get_tag ()

const char *        lt_lang_get_tag                     (const lt_lang_t *lang);

Obtains the tag name.

lang :

a lt_lang_t.

Returns :

a tag string.

lt_lang_ref ()

lt_lang_t *         lt_lang_ref                         (lt_lang_t *lang);

Increases the reference count of lang.

lang :

a lt_lang_t.

Returns :

the same lang object. [transfer none]

lt_lang_t

typedef struct _lt_lang_t lt_lang_t;

All the fields in the lt_lang_t structure are private to the lt_lang_t implementation.


lt_lang_unref ()

void                lt_lang_unref                       (lt_lang_t *lang);

Decreases the reference count of lang. when its reference count drops to 0, the object is finalized (i.e. its memory is freed).

lang :

a lt_lang_t.