chsvlib
chsv helper source code

◆ SetDescription() [3/5]

void SetDescription ( const Chusov::String::TAG_DESCRIPTION_PARAM< char_t > *restrict  pTags,
std::size_t  cTags,
Exception::vararg_tag_t  ,
const char_t *restrict  pszDescriptionFormat,
std::va_list  ap 
)
protectednoexcept

Sets a new description for the class object. The description is specified by Printf formatting sequences and by tags.

Template Parameters
char_tis a type of the description to be set which is either char or wchar_t.
Parameters
[in]pTagsis a pointer to a vector (implemented as a raw block of memory) specifying tags to be replaced during the synthesis of the description. See the Chusov::String::AllocateAndFormatStringByTagsIndirectW function for the details. If the parameter defines <CODE> and/or <DESCRIPTION> tags, the definitions of the ones are ignored as they are reserved to specify an insertion location (within the resulting description) for a string hexadecimal representation of the errc value and the corresponding description respectively.
[in]cTagsis a size of the vector of tags, in elements.
[in]apis a variable argument list to be used for the Printf formatting.
[in]pszDescriptionFormatis a constant pointer to a C string specifying a formatting string, together with the tags and the variable-argument list specifying a layout of the description. The pointer can be NULL causing the function to set the description to be equal to a value returned by the Chusov::ChsvErrorDescription function of errc and to ignore all other parameters.

The function is a wrap around the ChsvCodeException::SetCodeAndDescription(code_t nCode, fn_t &&GetDescription, const String::TAG_DESCRIPTION_PARAM<char_t> *restrict pTags, std::size_t cTags, std::va_list ap, const wchar_t *restrict lpszDescriptionFormat).

The tag formatting includes processing of tags specified by the pTags vector as well as the defined by default <CODE> and <DESCRIPTION> tags. The default tags are processed even if the pTags vector is empty or NULL. The one cannot redefine the processing of the default tags in other way than just disabling it. To disable tag-processing use the SetDescription(noformat, const char_t*) overload.