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.
©2004-2007 Copyright Quovadx, Inc. All Rights Reserved.
Quovadx and Rogue Wave are registered trademarks of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.