chsvlib
chsv helper source code

◆ AllocateAndFormatStringByTagsVW()

wchar_t* Chusov::String::AllocateAndFormatStringByTagsVW ( va_list  ap,
const wchar_t *restrict  lpszTagFormatString,
unsigned int  cNumberOfTagsPresent 
)

Allocates and initializes a string defined by format specified using PrintfW_s control sequences and user-defined tags.

Parameters
apis a variable list of arguments containing parameters describing tags and then the parameters for the PrintfW_s sequences. The first parameters constitute a set of groups defining associations for the tags. The last parameters are processed to perform the PrintfW_s formatting. The parameters for the tag formatting are defined by groups. Each one consists on a tag name string, a pointer to a callback procedure associating the tag with the user-defined description, a user defined parameter for the callback and the flag signaling if the description would be the same for the all instances of the tag in the format. See description of the AllocateAndFormatStringByTagsW function for further explanation.
[in]lpszTagFormatStringis a zero-terminated wide string specifying format using PrintfW_s control sequences and tag words. The last ones are delimited by single left and right brackets, i.e. <tag>. The brackets themselves are encoded as "<<" for '<' and ">>" for '>'.
cNumberOfTagsPresentis a number of different tags specified in the format string and, therefore, a number of groups of entities of the variable parameters list. See remarks for further explanation.
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 namespace. On failure the function returns NULL. Use GetLastChsvError function to get extended error information.
Remarks
See the definition of the AllocateAndFormatStringByTagsW function for more detailed information about the function.
See also
AllocateAndFormatStringByTagsW;
AllocateAndFormatStringByTagsIndirectW;
AllocateStringW;
AllocateAndFormatStringW;
FreeStringW;
SecureFreeStringW.