The constructor for rwsf::LocalizedMessage provides a mechanism for looking up a localized string based on it's identifier. For example:
rwsf::LocalizedMessage msg(RWSF_CORE_ILLEGAL_INDEX);
You can then substitute any dynamic content using the replace() member function, or the templatized left shift operator (operator<<):
size_t index = 37; size_t size = 35; msg.replace(index); // Replaces %1% msg << size; // Replaces $2%
Finally, the localized, updated string can be accessed through the getMessage() member function:
std::cout << msg.getMessage() << std::endl;
For an example demonstrating throwing an rwsf::Exception containing an rwsf::LocalizedMessage, see Section 8.2.2.
© Copyright Rogue Wave Software, Inc. All Rights Reserved. All Rights Reserved. Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. HydraExpress is a trademark of Rogue Wave Software, Inc. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.