chsvlib
chsv helper source code

◆ SetCodeAndDescription() [1/8]

auto SetCodeAndDescription ( code_t  nCode,
const char_t *  lpszDescription 
) -> std::enable_if_t<std::is_integral<char_t>::value>
protectednoexcept

Sets a new error code and description without any formatting.

Template Parameters
char_tis a type of the description to be set which is either char or wchar_t.
Parameters
[in]nCodeis a numeric value of the error code.
lpszDescriptionis a user-defined description. The parameter can be NULL, in which case the actual description set is a string saying that the description is undefined. Neither of the special formatting is performed by the function. If it is required to perform PrintfA formatting and/or formatting by tags, use other overloads of the function:
  • SetCodeAndDescription: The description is constructed using a format specified by tags.
  • SetCodeAndDescription: First, the description string is formatted as specified by PrintfA control sequences and corresponding additional parameters. Then the result is analyzed for a presence of tags in angle brackets, which are replaced by a textual representation of the code, by a description of a code, retrieved from a user-supplied callback functor, or as specified by additional rules.
  • SetCodeAndDescription The same as the previous, but additional parameters are past as a parameter list.