ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
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//==================================================================================================
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//==================================================================================================
56 const NString& resourceCategory,
57 const NString& resourceName,
59 int dbgSizeVerifier,
60 character outerSeparator = ',',
61 character innerSeparator = ' ' );
62#else
65 const NString& resourceCategory,
66 const NString& resourceName,
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
#define ALIB_DLL
Definition alib.inl:496
#define ALIB_EXPORT
Definition alib.inl:488
#define ALIB_DBG(...)
Definition alib.inl:836
void LoadResourcedTokens(camp::Camp &module, const NString &resourceName, strings::util::Token *target, int dbgSizeVerifier, character outerSeparator=',', character innerSeparator=' ')
strings::TString< nchar > NString
Type alias in namespace alib.
Definition string.inl:2390
characters::character character
Type alias in namespace alib.