ALib C++ Library
by
Library Version:
2510 R0
Documentation generated by
Loading...
Searching...
No Matches
home
dev
A-Worx
ALib
src
alib
resources
extensions
strings_loadtokens.inl
Go to the documentation of this file.
1
//==================================================================================================
2
/// \file
3
/// This header-file is part of module \alib_resources of the \aliblong.
4
///
5
/// \emoji :copyright: 2013-2025 A-Worx GmbH, Germany.
6
/// Published under \ref mainpage_license "Boost Software License".
7
//==================================================================================================
8
ALIB_EXPORT
namespace
alib::strings::util
{
9
10
#if ALIB_ENUMRECORDS
11
#if DOXYGEN
12
//==================================================================================================
13
/// A utility namespace function that defines a table of token objects from external resourced
14
/// strings.
15
///
16
/// It is possible to provide the table lines in two ways:
17
/// - In one resource string: In this case, parameter \p{outerDelim} has to specify
18
/// the delimiter that separates the records.
19
/// - In an array of resource strings: If the resource string as given is not defined, this
20
/// method appends an integral index starting with \c 0 to the resource name, parses
21
/// a single record and increments the index.
22
/// Parsing ends when the next higher index is not found.
23
///
24
/// The second option is recommended for larger token sets. While the separation causes
25
/// some overhead in a resource backend, the external (!) management (translation,
26
/// manipulation, etc.) is most probably simplified with this approach.
27
///
28
/// \note
29
/// The length of the given table has to fit to the number of entries found in
30
/// the resource pool. To ensure this, with debug-builds, parameter \p{dbgSizeVerifier}
31
/// has to be provided (preferably by using macro \ref ALIB_DBG "ALIB_DBG(, N)").
32
///
33
/// \par Availability
34
/// This function is an extension, which is injected by the higher-level module \alib_resources
35
/// and is accessed through the header file \implude{Resources}.
36
/// Furthermore, the module \alib_enumrecords has to be included in the \alibbuild.
37
/// @param resourcePool The resource pool to load the resource from.
38
/// @param resourceCategory The resource category.
39
/// @param resourceName The resource name.
40
/// @param target The table to fill.
41
/// @param dbgSizeVerifier This parameter has to be specified only in debug-builds and
42
/// provides the expected size of the resourced table.
43
/// To be surrounded by macro #ALIB_DBG (not to be given in
44
/// release-builds.)
45
/// @param outerSeparator The character that separates the entries.
46
/// Defaults to <c>','</c>.
47
/// @param innerSeparator The character that separates the values of an entry.
48
/// Defaults to <c>' '</c> (space).
49
///
50
/// \par Module Dependencies
51
/// This method is only available if the modules \alib_resources and \alib_enumrecords are
52
/// included in the \alibbuild.
53
//==================================================================================================
54
ALIB_DLL
55
void
LoadResourcedTokens
(
resources::ResourcePool
& resourcePool,
56
const
NString
& resourceCategory,
57
const
NString
& resourceName,
58
strings::util::Token
* target,
59
int
dbgSizeVerifier,
60
character
outerSeparator =
','
,
61
character
innerSeparator =
' '
);
62
#else
63
ALIB_DLL
64
void
LoadResourcedTokens
(
resources::ResourcePool
& resourcePool,
65
const
NString
& resourceCategory,
66
const
NString
& resourceName,
67
strings::util::Token
* target,
68
ALIB_DBG
(
int
dbgSizeVerifier, )
69
character
outerSeparator =
','
,
70
character
innerSeparator =
' '
);
71
#endif
// DOXYGEN
72
#endif
// ALIB_ENUMRECORDS
73
74
75
}
// namespace [alib::strings::util]
76
77
78
alib::resources::ResourcePool
Definition
resources.inl:24
alib::strings::util::Token
Definition
token.inl:131
ALIB_DLL
#define ALIB_DLL
Definition
alib.inl:496
ALIB_EXPORT
#define ALIB_EXPORT
Definition
alib.inl:488
ALIB_DBG
#define ALIB_DBG(...)
Definition
alib.inl:836
alib::strings::util
Definition
ALib.Strings.Vector.H:21
alib::strings::util::LoadResourcedTokens
void LoadResourcedTokens(camp::Camp &module, const NString &resourceName, strings::util::Token *target, int dbgSizeVerifier, character outerSeparator=',', character innerSeparator=' ')
alib::NString
strings::TString< nchar > NString
Type alias in namespace alib.
Definition
string.inl:2390
alib::character
characters::character character
Type alias in namespace alib.
Definition
chartypes.inl:144