source: icXML/icXML-devel/src/icxercesc/util/XMLUTF16Transcoder.hpp @ 2721

Last change on this file since 2721 was 2721, checked in by cameron, 6 years ago

Fix imports in icXML modified Xerces files

File size: 3.4 KB
Line 
1/*
2 * Unless required by applicable law or agreed to in writing, software
3 * distributed under the License is distributed on an "AS IS" BASIS,
4 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5 * See the License for the specific language governing permissions and
6 * limitations under the License.
7 */
8
9/*
10 * $Id: XMLUTF16Transcoder.hpp 932887 2010-04-11 13:04:59Z borisk $
11 */
12
13#if !defined(XERCESC_INCLUDE_GUARD_XMLUTF16TRANSCODER_HPP)
14#define XERCESC_INCLUDE_GUARD_XMLUTF16TRANSCODER_HPP
15
16#include <xercesc/util/XercesDefs.hpp>
17#include <icxercesc/util/TransService.hpp>
18#include <icxercesc/internal/XMLReader.hpp>
19#include <icxmlc/XMLUTF16CharacterSetAdapter.hpp>
20// #include <icxmlc/XMLErrorTracker.hpp>
21#include <icxmlc/XMLConfig.hpp>
22
23XERCES_CPP_NAMESPACE_BEGIN
24
25//
26//  This class provides an implementation of the XMLTranscoder interface
27//  for a simple UTF16 transcoder. The parser does some encodings
28//  intrinsically without depending upon external transcoding services.
29//  To make everything more orthogonal, we implement these internal
30//  transcoders using the same transcoder abstraction as the pluggable
31//  transcoding services do.
32//
33class XMLUTIL_EXPORT XMLUTF16Transcoder : public XMLTranscoder
34{
35        friend class XMLUTF16CharacterSetAdapter;
36
37public :
38        // -----------------------------------------------------------------------
39        //  Public constructors and destructor
40        // -----------------------------------------------------------------------
41        XMLUTF16Transcoder
42        (
43                const   XMLCh* const    encodingName
44                , const XMLSize_t       blockSize
45                , const bool            swapped
46                , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
47        );
48
49        virtual ~XMLUTF16Transcoder();
50
51
52        // -----------------------------------------------------------------------
53        //  Implementation of the XMLTranscoder interface
54        // -----------------------------------------------------------------------
55        virtual XMLSize_t transcodeFrom
56        (
57                const   XMLByte* const          srcData
58                , const XMLSize_t               srcCount
59                ,       XMLCh* const            toFill
60                , const XMLSize_t               maxChars
61                ,       XMLSize_t&              bytesEaten
62                ,       unsigned char* const    charSizes
63        );
64
65        virtual XMLSize_t transcodeTo
66        (
67                const   XMLCh* const    srcData
68                , const XMLSize_t       srcCount
69                ,       XMLByte* const  toFill
70                , const XMLSize_t       maxBytes
71                ,       XMLSize_t&      charsEaten
72                , const UnRepOpts       options
73        );
74
75        virtual XMLSize_t transcodeFrom
76        (
77                  const XMLByte* const          srcData
78                , const XMLSize_t               srcCount
79                ,       XMLBuffer &             toFill
80        );
81
82        virtual bool canTranscodeTo
83        (
84                const   unsigned int    toCheck
85        );
86
87
88private :
89        // -----------------------------------------------------------------------
90        //  Unimplemented constructors and operators
91        // -----------------------------------------------------------------------
92        XMLUTF16Transcoder(const XMLUTF16Transcoder&);
93        XMLUTF16Transcoder& operator=(const XMLUTF16Transcoder&);
94
95
96        // -----------------------------------------------------------------------
97        //  Private data members
98        //
99        //  fSwapped
100        //      Indicates whether the encoding is of the opposite endianness from
101        //      the local host.
102        // -----------------------------------------------------------------------
103        bool    fSwapped;
104};
105
106XERCES_CPP_NAMESPACE_END
107
108#if !defined(XERCES_TMPLSINC)
109#include <icxmlc/XMLReferenceTable.c>
110#endif
111
112#endif
Note: See TracBrowser for help on using the repository browser.