chsvlib
chsv helper source code

◆ AllocateAndFormatStringVW()

wchar_t* Chusov::String::AllocateAndFormatStringVW ( va_list  ap,
const wchar_t *restrict  lpszFormat 
)
noexcept

Allocates a string buffer and initializes it according to the specified format string and the argument list.

Parameters
[in]apis a variable-argument list. It contains a list of the input data for the string parser according to the format string.
[in]lpszFormatpoints to a zero-terminated string specifying output format according to the PrintfW_s format rules.
Returns
On success the function returns a pointer to the allocated and initialized string according to the format specified by the parameters. 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
The function is actually implemented as a wrap over the AllocateData function therefore it has analogous call rules as the other allocation functions of the Chusov::Memory namespace.
The Chusov::String namespace provides analogous functions for multibyte strings for every wide string counterpart. The analogues are declared with an 'A' (instead of 'W') suffix at the end of the name, e.g. AllocateStringA, FreeStringA, etc.
See also
AllocateStringW;
FreeStringW;
SecureFreeStringW;
AllocateAndFormatStringW;
AllocateAndFormatStringVA;
AllocateAndFormatStringByTagsW.