Guiliani  Version 2.5 revision 7293 (documentation build 13)
CGUILocalisationTable Class Reference

This class is used to store and provide international texts. More...

#include <GUILocalisationTable.h>

Public Member Functions

 CGUILocalisationTable ()
 
 ~CGUILocalisationTable ()
 
TextResource_t AddDynamicText (const eC_String &kNewText)
 
void FreeDynamicText (const TextResource_t eID)
 
const eC_String * GetDummyText () const
 
eC_UInt GetNOFLocalisationTexts () const
 
eC_UInt GetNOFReadTextResources () const
 
const eC_String * GetText (const TextResource_t &eTextResourcesIdx) const
 
eC_Bool IsValidID (const TextResource_t &eID) const
 
void LoadLocalisationFile (const eC_String &kLangFileName)
 
void RegisterTextFragments (const TextResource_t &eID, const eC_UInt &uiCount)
 
eC_Bool SetNOFLocalisationTexts (eC_UInt uiNOFLocalisationTexts)
 
void SetText (TextResource_t eID, const eC_String &rkText)
 
void SetTextFragment (const TextResource_t &eID, const eC_UInt &uiFragmentIndex, const eC_String &kText)
 
void UnregisterTextFragments (const TextResource_t &eID)
 
eC_Bool WriteLocalisationFile (const eC_String &kPath) const
 

Detailed Description

This class is used to store and provide international texts.

Constructor & Destructor Documentation

◆ CGUILocalisationTable()

CGUILocalisationTable::CGUILocalisationTable ( )

Default constructor.

◆ ~CGUILocalisationTable()

CGUILocalisationTable::~CGUILocalisationTable ( )

Destructor.

Member Function Documentation

◆ AddDynamicText()

TextResource_t CGUILocalisationTable::AddDynamicText ( const eC_String &  kNewText)

Adds new Text and returns a new ID.

Parameters
kNewTextThe text string we want to register to localisation table.
Returns
New TextResource ID.
Exceptions
CGUIExceptionWhen localisation string storage was unable to hold new text string.

◆ FreeDynamicText()

void CGUILocalisationTable::FreeDynamicText ( const TextResource_t  eID)

Frees a TextID which is no longer needed.

Parameters
eIDID of the text to free.
Exceptions
CGUIExceptionWhen the given ID is illegal

◆ GetDummyText()

const eC_String * CGUILocalisationTable::GetDummyText ( ) const

Gets the dummy text

Returns
The string of the dummy text

◆ GetNOFLocalisationTexts()

eC_UInt CGUILocalisationTable::GetNOFLocalisationTexts ( ) const

Returns the total number of localisation texts.

Returns
Number of localisation texts.

◆ GetNOFReadTextResources()

eC_UInt CGUILocalisationTable::GetNOFReadTextResources ( ) const

Get number of read text resources by last file operation.

Returns
Number of text lines read.

◆ GetText()

const eC_String * CGUILocalisationTable::GetText ( const TextResource_t eTextResourcesIdx) const

Retrieves a text from the internal text table.

Parameters
eTextResourcesIdxIndex of text to retrieve.
Returns
Constant pointer to the corresponding text string. If eTextResourcesIdx is DUMMY_TEXT, a pointer to an empty string is returned. In case of eTextResourcesIdx points to an uninitialized text, NULL is returned.

◆ IsValidID()

eC_Bool CGUILocalisationTable::IsValidID ( const TextResource_t eID) const

Checks if TextResource ID is valid.

Parameters
eIDTextResourceID to check.
Returns
True if valid else False.

◆ LoadLocalisationFile()

void CGUILocalisationTable::LoadLocalisationFile ( const eC_String &  kLangFileName)

Loads international text strings from a file to a table.

Parameters
kLangFileNameFile to load texts from.
Exceptions
CGUIExceptionIf language file could not be opened.

◆ RegisterTextFragments()

void CGUILocalisationTable::RegisterTextFragments ( const TextResource_t eID,
const eC_UInt &  uiCount 
)

Register text-fragments for a TextResource

Parameters
eIDID of the TextResource
uiCountnumber of fragments which should be registered

◆ SetNOFLocalisationTexts()

eC_Bool CGUILocalisationTable::SetNOFLocalisationTexts ( eC_UInt  uiNOFLocalisationTexts)

Sets the total number of texts.

Parameters
uiNOFLocalisationTextsNumber of localisation texts we want to store.
Returns
True if internal storage has been successfully adapted to support the requested number of texts. False otherwise.

◆ SetText()

void CGUILocalisationTable::SetText ( TextResource_t  eID,
const eC_String &  rkText 
)

Sets (changes) the text for a specific ID.

Parameters
eIDThe ID of the text to be changed.
rkTextThe text to be used for the ID.
Exceptions
CGUIExceptionIn case of an invalid text resource ID.

◆ SetTextFragment()

void CGUILocalisationTable::SetTextFragment ( const TextResource_t eID,
const eC_UInt &  uiFragmentIndex,
const eC_String &  kText 
)

Set the text for a text-fragment

Parameters
eIDID of the TextResource
uiFragmentIndexindex of the fragment
kTexttext to use in placeholder

◆ UnregisterTextFragments()

void CGUILocalisationTable::UnregisterTextFragments ( const TextResource_t eID)

Unregister text-fragments for a TextResource

Parameters
eIDID of the TextResource

◆ WriteLocalisationFile()

eC_Bool CGUILocalisationTable::WriteLocalisationFile ( const eC_String &  kPath) const

Writes all registered TextResources of the GUI to File.

Parameters
kPathPath and name of the destination file.
Returns
Always true.
Exceptions
CGUIExceptionIf destination file could not be opened. Or another unknown error occurred.

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