ALib C++ Framework
by
Library Version: 2511 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::strings::util Namespace Reference

Description:

This sub-namespace provides some utility classes which are related to string classes found in namespace strings.

Type Index:

class  AutoSizes
class  CalendarDate
class  CalendarDateTime
class  CalendarDuration
class  RegexMatcher
struct  StringEscaper
struct  StringEscaperStandard
class  Token
class  TStringSearch
class  TStringVector
class  TTokenizer
class  TWildcardMatcher

Function Index:

void LoadResourcedTokens (camp::Camp &module, const NString &resourceName, strings::util::Token *target, int dbgSizeVerifier, character outerSeparator=',', character innerSeparator=' ')
void LoadResourcedTokens (resources::ResourcePool &resourcePool, const NString &resourceCategory, const NString &resourceName, strings::util::Token *target, int dbgSizeVerifier, character outerSeparator=',', character innerSeparator=' ')

Function Details:

◆ LoadResourcedTokens() [1/2]

void alib::strings::util::LoadResourcedTokens ( camp::Camp & module,
const NString & resourceName,
strings::util::Token * target,
int dbgSizeVerifier,
character outerSeparator = ',',
character innerSeparator = ' ' )
inline

Shortcut to the sibling function LoadResourcedTokens that accepts an ALib Camp and uses its resource pool and resource category.

Parameters
moduleThe ALib Camp to load the resource from.
resourceNameThe resource name.
targetThe table to fill.
dbgSizeVerifierThis parameter has to be specified only in debug comilations and provides the expected size of the resourced table. To be surrounded by macro ALIB_DBG (not to be given in release-builds.)
outerSeparatorThe character that separates the entries. Defaults to ','.
innerSeparatorThe character that separates the values of an entry. Defaults to ' ' (space).
Module Dependencies
This method is only available if module ALib Camp is included in the ALib Build.

◆ LoadResourcedTokens() [2/2]

void alib::strings::util::LoadResourcedTokens ( resources::ResourcePool & resourcePool,
const NString & resourceCategory,
const NString & resourceName,
strings::util::Token * target,
int dbgSizeVerifier,
character outerSeparator = ',',
character innerSeparator = ' ' )

A utility namespace function that defines a table of token objects from external resourced strings.

It is possible to provide the table lines in two ways:

  • In one resource string: In this case, parameter outerDelim has to specify the delimiter that separates the records.
  • In an array of resource strings: If the resource string as given is not defined, this method appends an integral index starting with 0 to the resource name, parses a single record and increments the index. Parsing ends when the next higher index is not found.

The second option is recommended for larger token sets. While the separation causes some overhead in a resource backend, the external (!) management (translation, manipulation, etc.) is most probably simplified with this approach.

Note
The length of the given table has to fit to the number of entries found in the resource pool. To ensure this, with debug-builds, the parameter dbgSizeVerifier has to be provided (preferably by using the macro ALIB_DBG).
Availability
This function is an extension, which is injected by the higher-level module ALib Resources and is accessed through the header file ALib.Resources.H. Furthermore, the module ALib EnumRecords has to be included in the ALib Build.
Parameters
resourcePoolThe resource pool to load the resource from.
resourceCategoryThe resource category.
resourceNameThe resource name.
targetThe table to fill.
dbgSizeVerifierThis parameter has to be specified only in debug-builds and provides the expected size of the resourced table. To be surrounded by macro ALIB_DBG (not to be given in release-builds.)
outerSeparatorThe character that separates the entries. Defaults to ','.
innerSeparatorThe character that separates the values of an entry. Defaults to ' ' (space).
Module Dependencies
This method is only available if the modules ALib Resources and ALib EnumRecords are included in the ALib Build.