chsvlib
chsv helper source code

◆ AllocateAndFormatStringByTagsIndirect()

CHAR_TYPE* Chusov::String::AllocateAndFormatStringByTagsIndirect ( const CHAR_TYPE *restrict  lpszTagFormat,
unsigned int  cNumberOfTagsPresent,
const TAG_DESCRIPTION_PARAM< CHAR_TYPE > *restrict  pTagsParams 
)

Allocates and initializes a string formatted by user-defined tags.

Template Parameters
CHAR_TYPEis a type of the allocated string. Currently the template is defined only for CHAR_TYPE=char and CHAR_TYPE=wchar_t resolving to AllocateAndFormatStringByTagsIndirectA and AllocateAndFormatStringByTagsIndirectW respectively.
Parameters
[in]lpszTagFormatis a zero-terminated string specifying format using tag words placed within brackets, e.g. <tag>. The text outside of tags is copied to the formatted output.
cNumberOfTagsPresentis a number of different tags specified in the format string which is equal to a number of elements in the pTagsParams array of TAG_DESCRIPTION_PARAM structures.
[in]pTagsParamsis an array of TAG_DESCRIPTION_PARAM structures specialized for CHAR_TYPE template parameter and containing information for the parser to retrieve strings associated with each tag and to replace the tag in the input by it.
Returns
On success the function returns a pointer to the allocated memory holding the string constructed according to the specified format. The returned string buffer must be freed using one of the free functions defined in the Chusov::Memory or Chusov::String namespaces. On failure the function returns NULL. Use GetLastChsvError function to get extended error information.
Remarks
See AllocateAndFormatStringByTagsIndirectA or AllocateAndFormatStringByTagsIndirectW for more detailed information.
See also
AllocateAndFormatStringByTagsV;
AllocateAndFormatStringByTags;
AllocateString;
AllocateAndFormatString;
FreeString;
SecureFreeString.