Wt::WLocalizedStrings Class Reference

An abstract class that provides support for localized strings. More...

#include <Wt/WLocalizedStrings>

Inheritance diagram for Wt::WLocalizedStrings:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~WLocalizedStrings ()
 Destructor.
std::wstring getValue (const WString &s)
 Returns the value for a particular string in the current locale.
std::string getUTF8Value (const WString &s)
 Returns the UTF8-encoded value for a particular string in the current locale.
virtual void refresh ()
 Reread the message resources.
virtual void hibernate ()
 Purge memory resources, if possible.
virtual bool resolveKey (const std::string &key, std::string &result)=0
 Resolve a key in the current locale.


Detailed Description

An abstract class that provides support for localized strings.

This abstract class provides the content to localized WStrings, by resolving the key to a string using the current application locale.

See also:
WString::tr(), WApplication::setLocalizedStrings()

Member Function Documentation

std::wstring Wt::WLocalizedStrings::getValue ( const WString s  ) 

Returns the value for a particular string in the current locale.

This is equivalent to s.value().

std::string Wt::WLocalizedStrings::getUTF8Value ( const WString s  ) 

Returns the UTF8-encoded value for a particular string in the current locale.

This is equivalent to s.toUTF8().

void Wt::WLocalizedStrings::refresh (  )  [virtual]

Reread the message resources.

Purge any cached key/values, if applicable.

The default implementation does nothing.

Reimplemented in Wt::WMessageResourceBundle.

void Wt::WLocalizedStrings::hibernate (  )  [virtual]

Purge memory resources, if possible.

This is called afer event handling, and is an opportunity to conserve memory inbetween events, by freeing memory used for cached key/value bindings, if applicable.

The default implementation does nothing.

Reimplemented in Wt::WMessageResourceBundle.

virtual bool Wt::WLocalizedStrings::resolveKey ( const std::string &  key,
std::string &  result 
) [pure virtual]

Resolve a key in the current locale.

This method is used by WString to obtain the UTF8 value corresponding to a key in the current locale.

Returns true if the key could be resolved. The value is written in result, encoded using UTF8.

See also:
WApplication::locale()

Implemented in Wt::WMessageResourceBundle.


Generated on Fri Sep 12 17:01:14 2008 for Wt by doxygen 1.5.6