Constructs an exception object by a specified error code, a format string and Printf formatting parameters. .
- Template Parameters
-
char_t | is a type of the description to be set which is either char or wchar_t . |
- Parameters
-
[in] | nCode | is a code to be associated with the constructed exception object. |
| ap | is a list of parameters to be used during the construction of the description as specified for the Chusov::String::Printf function. If lpszDescriptionFormat is NULL the additional parameters are ignored. |
[in] | lpszDescriptionFormat | is an optional pointer to a string specifying a format of the constructed description. See the details. |
The constructor creates an instance of the ExceptionWithGenericCode<code_t>
class with associated error code and the description. The description is constructed as specified by the format string using control character sequences given for the Chusov::String::Printf <char_t> function. The result of this formatting is analyzed for presence of the <CODE> and <DESCRIPTION> tags which are replaced by a string representation of an error code and by the corresponding description respectively. Because the latter is not specified, the corresponding description states that fact. To specify a function objects which maps the error code use the ExceptionWithGenericCode(code_t nCode, fn_t&& GetDescription, std::va_list ap, const char_t* restrict lpszDescriptionFormat) constructor.
- See also
- ExceptionWithGenericCode(code_t nCode, fn_t&& GetDescription, std::va_list ap, const char_t* restrict lpszDescriptionFormat);
ExceptionWithGenericCode(code_t nCode, const char_t* restrict lpszDescriptionFormat, DescriptionFormatParams... formatting_params);
ExceptionWithGenericCode(code_t nCode, fn_t&& GetDescription, const char_t* restrict lpszDescriptionFormat, DescriptionFormatParams... formatting_params).