Read error message from txt file to a map, only initialize the map at the first time the class was constructed.
Support multithread.
Definition at line 173 of file osbmsgcat.h.
typedef std::vector<std::string> OSB_LIB::ErrList::BaseText [private] |
typedef std::map<BaseError::ErrorNo, BaseText> OSB_LIB::ErrList::TextMap [private] |
OSB_LIB::ErrList::ErrList | ( | const std::string & | filename | ) | [private] |
Constructor.
OSB_LIB::ErrList::ErrList | ( | const ErrList & | ) | [private] |
Prevent copying: Copy constructor not implemented.
void OSB_LIB::ErrList::compose | ( | std::string & | dest, | |
const std::string & | errMsg, | |||
const BaseError::Args & | errArgs | |||
) | const [private] |
Compose the internal error message and the error arguments to the error message.
dest | Gets the composed error message. | |
errMsg | The internal error message. | |
errArgs | The error arguments. |
void OSB_LIB::ErrList::compose | ( | std::string & | dest, | |
const BaseText & | text, | |||
const BaseError::Args & | errArgs | |||
) | const [private] |
Compose the error text and the error arguments to the error message.
dest | Gets the composed error message. | |
text | The base error text. | |
errArgs | The error arguments. |
const std::string& OSB_LIB::ErrList::errMsg | ( | ) | const [inline] |
const BaseText* OSB_LIB::ErrList::getText | ( | OsbBaseError::ErrorNo | errNo | ) | const [private] |
Get error message template.
errNo | Error number for which to get the template. |
bool OSB_LIB::ErrList::mkErrorMsg | ( | std::string & | dest, | |
BaseError::ErrorNo | errNo, | |||
const BaseError::Args & | errArgs | |||
) | const |
Get the error text and compose them with the error arguments to the error message.
In case of an internal error or if the template for the error number can not be found, an appropriate general error message is assigned to `dest'.
dest | Gets the composed error message. | |
errNo | The error number. | |
errArgs | The error arguments. |
Prevent copying: Assignment operator not implemented.
void OSB_LIB::ErrList::separate | ( | BaseText & | dest, | |
const std::string & | errStr | |||
) | [private] |
Separate the whole line error message to scrap error text.
dest | Gets the separated error text. | |
errStr | The error message. |
friend class MsgCat [friend] |
std::string OSB_LIB::ErrList::errMsg_ [private] |
TextMap OSB_LIB::ErrList::textMap_ [private] |