chsvlib
chsv helper source code

◆ AllocateAndFormatStringByTagsVA()

char* Chusov::String::AllocateAndFormatStringByTagsVA ( va_list  ap,
const char *restrict  lpszTagFormatString,
unsigned int  cNumberOfTagsPresent 
)

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

Parameters
apis a variable list of arguments containing parameters describing tags and parameters for the PrintfA_s sequences. The first set of the parameters constitute a set of groups defining associations for the tags. The last set is processed to perform the sPrintfA_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 AllocateAndFormatStringByTagsA function for further explanation.
[in]lpszTagFormatStringis a zero-terminated multibyte string specifying format using PrintfA_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 '>'.
[in]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 description of the AllocateAndFormatStringByTagsA function 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 AllocateAndFormatStringByTagsA function for more detailed information about the function.
See also
AllocateAndFormatStringByTagsA;
AllocateAndFormatStringByTagsIndirectA;
AllocateStringA;
AllocateAndFormatStringA;
FreeStringA;
SecureFreeStringA.