MPLABĀ® Harmony Graphics Suite
Data Structures | Macros | Typedefs | Enumerations | Functions
legato_stringtable.h File Reference

String table functions and definitions. More...

#include "gfx/legato/common/legato_common.h"
#include "gfx/legato/font/legato_font.h"
Include dependency graph for legato_stringtable.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  leStringTable
 This struct represents string a string table. More...
 
struct  leStringInfo
 This struct represents string a string table entry. More...
 

Macros

#define LE_STRING_ARRAY_SIZE   4
 
#define LE_STRING_ENTRY_SIZE   2
 
#define LE_STRING_MAX_CHAR_WIDTH   6
 

Typedefs

typedef enum leStringEncodingMode leStringEncodingMode
 This enum represents string encoding modes. More...
 
typedef struct leStringTable leStringTable
 This struct represents string a string table. More...
 
typedef struct leStringInfo leStringInfo
 This struct represents string a string table entry.
 

Enumerations

enum  leStringEncodingMode { LE_STRING_ENCODING_ASCII, LE_STRING_ENCODING_UTF8, LE_STRING_ENCODING_UTF16 }
 This enum represents string encoding modes. More...
 

Functions

LIB_EXPORT uint32_t leStringTable_GetStringCount (const leStringTable *table)
 Gets the number of strings in a string table. More...
 
LIB_EXPORT uint32_t leStringTable_GetLanguageCount (const leStringTable *table)
 Get number of languages in a string table. More...
 
LIB_EXPORT uint32_t leStringTable_GetStringOffset (const leStringTable *table, uint32_t stringID, uint32_t languageID)
 Get offset of a string in table by string and language ID. More...
 
LIB_EXPORT uint32_t leStringTable_GetActiveStringOffset (const leStringTable *table, uint32_t stringID)
 Get offset of a string in table using active global language. More...
 
LIB_EXPORT leFontleStringTable_GetStringFont (const leStringTable *table, uint32_t stringID, uint32_t languageID)
 Get font for a string table string. More...
 
LIB_EXPORT leResult leStringTable_StringLookup (const leStringTable *table, leStringInfo *info)
 Get info for a string table string. More...
 
LIB_EXPORT leResult leStringTable_GetStringLength (const leStringTable *table, leStringInfo *info)
 Get length of a string in the string table in codepoints. More...
 

Detailed Description

String table functions and definitions.

Typedef Documentation

◆ leStringEncodingMode

This enum represents string encoding modes.

String encoding modes are used to encode text.

◆ leStringTable

typedef struct leStringTable leStringTable

This struct represents string a string table.

String table is used to describe a string table asset. There is typically only ever one of these defined at any one time.

Enumeration Type Documentation

◆ leStringEncodingMode

This enum represents string encoding modes.

String encoding modes are used to encode text.

Function Documentation

◆ leStringTable_GetActiveStringOffset()

LIB_EXPORT uint32_t leStringTable_GetActiveStringOffset ( const leStringTable table,
uint32_t  stringID 
)

Get offset of a string in table using active global language.

Gets the offset of a string in table by stringID.

uint32_t off = leStringTable_GetActiveStringOffset(table, stringID);
Parameters
tableis the table to query.
stringIDis the search criteria.
Returns
the offset of the string in bytes.
Here is the call graph for this function:

◆ leStringTable_GetLanguageCount()

LIB_EXPORT uint32_t leStringTable_GetLanguageCount ( const leStringTable table)

Get number of languages in a string table.

Gets the number of languages in table.

uint32_t cnt = leStringTable_GetLanguageCount(table);
Parameters
tableis the table to query.
Returns
the number of languages in the table.

◆ leStringTable_GetStringCount()

LIB_EXPORT uint32_t leStringTable_GetStringCount ( const leStringTable table)

Gets the number of strings in a string table.

Gets the number of strings in table.

uint32_t cnt = leStringTable_GetStringCount(table);
Parameters
tableis the table to query.
Returns
the number of strings in the table.

◆ leStringTable_GetStringFont()

LIB_EXPORT leFont* leStringTable_GetStringFont ( const leStringTable table,
uint32_t  stringID,
uint32_t  languageID 
)

Get font for a string table string.

Gets the font in table by stringID and languageID.

uint32_t stringID;
uint32_t languageID;
leFont* font = leStringTable_GetActiveStringOffset(table, stringID, languageID);
Parameters
tableis the table to query.
stringIDthe string search criteria.
languageIDthe language search criteria.
Returns
the font for the string.

◆ leStringTable_GetStringLength()

LIB_EXPORT leResult leStringTable_GetStringLength ( const leStringTable table,
leStringInfo info 
)

Get length of a string in the string table in codepoints.

Gets the length of a string in table by info.

Parameters
tableis the table to query.
infois the info search criteria.
Returns
LE_SUCCESS if set, otherwise LE_FAILURE.

◆ leStringTable_GetStringOffset()

LIB_EXPORT uint32_t leStringTable_GetStringOffset ( const leStringTable table,
uint32_t  stringID,
uint32_t  languageID 
)

Get offset of a string in table by string and language ID.

Gets the offset of a string in table by stringID and languageID.

uint32_t off = leStringTable_GetStringOffset(table, stringID, languageID);
Parameters
tableis the table to query.
stringIDthe search criteria.
languageIDthe search criteria.
Returns
the offset of the string in bytes.
Here is the caller graph for this function:

◆ leStringTable_StringLookup()

LIB_EXPORT leResult leStringTable_StringLookup ( const leStringTable table,
leStringInfo info 
)

Get info for a string table string.

Gets the offset of a string in table by info.

Parameters
tableis the table to query.
infois the filled leStringInfo structure
Returns
LE_SUCCESS if set, otherwise LE_FAILURE.
leResult
leResult
This enum represents function call results.
Definition: legato_common.h:134
leStringTable_GetStringOffset
LIB_EXPORT uint32_t leStringTable_GetStringOffset(const leStringTable *table, uint32_t stringID, uint32_t languageID)
Get offset of a string in table by string and language ID.
Definition: legato_stringtable.c:73
leFont
This struct represents a font object.
Definition: legato_font.h:136
leStringTable_GetStringCount
LIB_EXPORT uint32_t leStringTable_GetStringCount(const leStringTable *table)
Gets the number of strings in a string table.
Definition: legato_stringtable.c:49
leStringTable_GetActiveStringOffset
LIB_EXPORT uint32_t leStringTable_GetActiveStringOffset(const leStringTable *table, uint32_t stringID)
Get offset of a string in table using active global language.
Definition: legato_stringtable.c:104
leStringTable_GetStringLength
LIB_EXPORT leResult leStringTable_GetStringLength(const leStringTable *table, leStringInfo *info)
Get length of a string in the string table in codepoints.
Definition: legato_stringtable.c:214
leStringTable
This struct represents string a string table.
Definition: legato_stringtable.h:80
leStringTable_GetLanguageCount
LIB_EXPORT uint32_t leStringTable_GetLanguageCount(const leStringTable *table)
Get number of languages in a string table.
Definition: legato_stringtable.c:61
leStringInfo
This struct represents string a string table entry.
Definition: legato_stringtable.h:102