|
OpenTop 1.3 | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | Cross-Platform C++ | ||||
SUMMARY: CONSTRUCTOR | METHOD | DETAIL: CONSTRUCTOR | METHOD |
#include "ot/cvt/CodeConverterFactory.h"
Applications can extend OpenTop by supplementing their own encodings. To achieve this the application must create a new factory class derived from CodeConverterFactory and set an instance of the derived class as the global CodeConverterFactory by calling SetInstance().
Method Summary | |
RefPtr< CodeConverter > |
getConverter(const String& encoding) const Returns a new instance of a CodeConverter that can encode and decode the requested encoding. |
RefPtr< CodeConverter > |
getDefaultConverter() const Returns a new instance of a CodeConverter that is suitable for the target platform. |
static CodeConverterFactory& |
GetInstance() Returns the global CodeConverterFactory. |
static void |
SetInstance(CodeConverterFactory* pFactory) Sets the global CodeConverterFactory instance. |
Methods inherited from class ot::ManagedObject |
addRef, getRefCount, onFinalRelease, operator=, release |
Method Detail |
RefPtr< CodeConverter > getConverter(const String& encoding) const
encoding
- RefPtr< CodeConverter > getDefaultConverter() const
In the current implementation a CodeConverter that encodes and decodes ISO-8859-1 (Latin1) is always returned.
static CodeConverterFactory& GetInstance()
static void SetInstance(CodeConverterFactory* pFactory)
Like other OpenTop global objects, CodeConverterFactory is a ManagedObject. This enables the passed object to be registered with the system's ObjectManager, thereby freeing the application from having to manage the lifetime of the factory object. In other words, the application does not need to maintain the object's reference-count once it has been registered.
A typical application may do the following:-
CodeConverterFactory::SetInstance(new MyCodeConverterFactory);
|
OpenTop 1.3 | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | Cross-Platform C++ | ||||
SUMMARY: CONSTRUCTOR | METHOD | DETAIL: CONSTRUCTOR | METHOD |