TextEncoding.h
Go to the documentation of this file.
00001 //
00002 // TextEncoding.h
00003 //
00004 // $Id: //poco/1.3/Foundation/include/Poco/TextEncoding.h#2 $
00005 //
00006 // Library: Foundation
00007 // Package: Text
00008 // Module:  TextEncoding
00009 //
00010 // Definition of the abstract TextEncoding class.
00011 //
00012 // Copyright (c) 2004-2007, Applied Informatics Software Engineering GmbH.
00013 // and Contributors.
00014 //
00015 // Permission is hereby granted, free of charge, to any person or organization
00016 // obtaining a copy of the software and accompanying documentation covered by
00017 // this license (the "Software") to use, reproduce, display, distribute,
00018 // execute, and transmit the Software, and to prepare derivative works of the
00019 // Software, and to permit third-parties to whom the Software is furnished to
00020 // do so, all subject to the following:
00021 // 
00022 // The copyright notices in the Software and this entire statement, including
00023 // the above license grant, this restriction and the following disclaimer,
00024 // must be included in all copies of the Software, in whole or in part, and
00025 // all derivative works of the Software, unless such copies or derivative
00026 // works are solely in the form of machine-executable object code generated by
00027 // a source language processor.
00028 // 
00029 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00030 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00031 // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
00032 // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
00033 // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
00034 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00035 // DEALINGS IN THE SOFTWARE.
00036 //
00037 
00038 
00039 #ifndef Foundation_TextEncoding_INCLUDED
00040 #define Foundation_TextEncoding_INCLUDED
00041 
00042 
00043 #include "Poco/Foundation.h"
00044 #include "Poco/SharedPtr.h"
00045 
00046 
00047 namespace Poco {
00048 
00049 
00050 class TextEncodingManager;
00051 
00052 
00053 class Foundation_API TextEncoding
00064 {
00065 public:
00066         typedef SharedPtr<TextEncoding> Ptr;
00067         
00068         enum
00069         {
00070                 MAX_SEQUENCE_LENGTH = 6 
00071         };
00072         
00073         typedef int CharacterMap[256];
00081 
00082         virtual ~TextEncoding();
00084 
00085         virtual const char* canonicalName() const = 0;
00089 
00090         virtual bool isA(const std::string& encodingName) const = 0;
00095                         
00096         virtual const CharacterMap& characterMap() const = 0;
00103                 
00104         virtual int convert(const unsigned char* bytes) const;
00112 
00113         virtual int convert(int ch, unsigned char* bytes, int length) const;
00122 
00123         static TextEncoding& byName(const std::string& encodingName);
00127                 
00128         static TextEncoding::Ptr find(const std::string& encodingName);
00131 
00132         static void add(TextEncoding::Ptr encoding);
00138 
00139         static void add(TextEncoding::Ptr encoding, const std::string& name);
00145 
00146         static void remove(const std::string& encodingName);
00149 
00150         static TextEncoding::Ptr global(TextEncoding::Ptr encoding);
00155 
00156         static TextEncoding& global();
00158 
00159         static const std::string GLOBAL;
00161                 
00162 protected:
00163         static TextEncodingManager& manager();
00165 };
00166 
00167 
00168 } // namespace Poco
00169 
00170 
00171 #endif // Foundation_TextEncoding_INCLUDED


pluginlib
Author(s): Tully Foote and Eitan Marder-Eppstein
autogenerated on Sat Dec 28 2013 17:20:19