CLI  2.9
ResourceString Class Reference

ResourceString class. More...

#include <resource_string.h>

Inheritance diagram for ResourceString:

Public Types

enum  LANG { LANG_EN, LANG_FR, LANG_COUNT, LANG_DEFAULT = LANG_EN }
 Languages identifiers. More...
 

Public Member Functions

 ResourceString (void)
 Default constructor. More...
 
 ResourceString (const ResourceString &CLI_String)
 Copy constructor. More...
 
virtual ~ResourceString (void)
 Destructor. More...
 
ResourceStringoperator= (const ResourceString &STR_String)
 Assignment operator. More...
 
ResourceStringReset (void)
 Resets the resource string. More...
 
ResourceStringSetString (const LANG E_Lang, const char *const STR_String)
 Adds resource for a given language. More...
 
const bool HasString (const LANG E_Lang) const
 Determines whether a string exists for a given language. More...
 
const tk::String GetString (const LANG E_Lang) const
 Access to the string of a given language. More...
 
const bool IsEmpty (void) const
 Determines whether the resource string is empty (ie no string has been set for any language). More...
 
- Public Member Functions inherited from Object
virtual ~Object (void)=0
 Pure virtual destructor. More...
 

Static Public Member Functions

static const tk::String Concat (const char *const STR_1, const char *const STR_2)
 String concatenation in the aim of a resource definition. More...
 
static const tk::String Concat (const char *const STR_1, const char *const STR_2, const char *const STR_3)
 String concatenation in the aim of a resource definition. More...
 
static const tk::String Concat (const char *const STR_1, const char *const STR_2, const char *const STR_3, const char *const STR_4)
 String concatenation in the aim of a resource definition. More...
 
static const tk::String Concat (const char *const STR_1, const char *const STR_2, const char *const STR_3, const char *const STR_4, const char *const STR_5)
 String concatenation in the aim of a resource definition. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Object
 Object (void)
 Default constructor only available to sub-classes. More...
 

Detailed Description

ResourceString class.

Objects of this class permits string definition of different languages.

Definition at line 45 of file resource_string.h.

Member Enumeration Documentation

◆ LANG

Languages identifiers.

Enumerator
LANG_EN 

English.

LANG_FR 

French.

LANG_COUNT 

Languages count.

Definition at line 68 of file resource_string.h.

Constructor & Destructor Documentation

◆ ResourceString() [1/2]

ResourceString::ResourceString ( void  )
explicit

Default constructor.

◆ ResourceString() [2/2]

ResourceString::ResourceString ( const ResourceString CLI_String)

Copy constructor.

Parameters
CLI_StringSource string object.

◆ ~ResourceString()

virtual ResourceString::~ResourceString ( void  )
virtual

Destructor.

Member Function Documentation

◆ Concat() [1/4]

static const tk::String ResourceString::Concat ( const char *const  STR_1,
const char *const  STR_2 
)
static

String concatenation in the aim of a resource definition.

Returns
The concatenation of the string arguments.
Parameters
STR_1First string.
STR_2Second string.

◆ Concat() [2/4]

static const tk::String ResourceString::Concat ( const char *const  STR_1,
const char *const  STR_2,
const char *const  STR_3 
)
static

String concatenation in the aim of a resource definition.

Returns
The concatenation of the string arguments.
Parameters
STR_1First string.
STR_2Second string.
STR_3Third string.

◆ Concat() [3/4]

static const tk::String ResourceString::Concat ( const char *const  STR_1,
const char *const  STR_2,
const char *const  STR_3,
const char *const  STR_4 
)
static

String concatenation in the aim of a resource definition.

Returns
The concatenation of the string arguments.
Parameters
STR_1First string.
STR_2Second string.
STR_3Third string.
STR_4Fourth string.

◆ Concat() [4/4]

static const tk::String ResourceString::Concat ( const char *const  STR_1,
const char *const  STR_2,
const char *const  STR_3,
const char *const  STR_4,
const char *const  STR_5 
)
static

String concatenation in the aim of a resource definition.

Returns
The concatenation of the string arguments.
Parameters
STR_1First string.
STR_2Second string.
STR_3Third string.
STR_4Fourth string.
STR_5Fifth string.

◆ GetString()

const tk::String ResourceString::GetString ( const LANG  E_Lang) const

Access to the string of a given language.

Returns
The string defined for the given language.

If the string does not exist for the given language, the defaultt language is used.

Parameters
E_LangLanguage identifier.

◆ HasString()

const bool ResourceString::HasString ( const LANG  E_Lang) const

Determines whether a string exists for a given language.

Returns
true: The resource string has a string set for the given language.
false: The resource string has no string set for the given language.
Parameters
E_LangLanguage identifier.

◆ IsEmpty()

const bool ResourceString::IsEmpty ( void  ) const

Determines whether the resource string is empty (ie no string has been set for any language).

Returns
true: The resource string is empty.
false: The resource string is not empty.

◆ operator=()

ResourceString& ResourceString::operator= ( const ResourceString STR_String)

Assignment operator.

Returns
The ResourceString instance itself.
Parameters
STR_StringSource string object.

◆ Reset()

ResourceString& ResourceString::Reset ( void  )

Resets the resource string.

Returns
The ResourceString instance itself.
Author
[contrib: Oleg Smolsky, 2010, based on CLI 2.5]

◆ SetString()

ResourceString& ResourceString::SetString ( const LANG  E_Lang,
const char *const  STR_String 
)

Adds resource for a given language.

Returns
The ResourceString instance itself.

If a string already exists for the given language, then it is overwritten.

Parameters
E_LangLanguage identifier.
STR_StringString.

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