source: NonGTP/Xerces/xerces/include/xercesc/util/Transcoders/Iconv/IconvTransService.hpp @ 358

Revision 358, 6.7 KB checked in by bittner, 19 years ago (diff)

xerces added

Line 
1/*
2 * Copyright 1999-2000,2004 The Apache Software Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/*
18 * $Log: IconvTransService.hpp,v $
19 * Revision 1.8  2004/09/08 13:56:44  peiyongz
20 * Apache License Version 2.0
21 *
22 * Revision 1.7  2003/12/24 15:24:15  cargilld
23 * More updates to memory management so that the static memory manager.
24 *
25 * Revision 1.6  2003/05/15 18:47:03  knoaman
26 * Partial implementation of the configurable memory manager.
27 *
28 * Revision 1.5  2003/03/07 18:15:57  tng
29 * Return a reference instead of void for operator=
30 *
31 * Revision 1.4  2003/01/06 21:48:05  tng
32 * Remove obsolete old functions transcodeXML and transcodeOne
33 *
34 * Revision 1.3  2002/11/04 15:14:33  tng
35 * C++ Namespace Support.
36 *
37 * Revision 1.2  2002/04/09 15:44:00  knoaman
38 * Add lower case string support.
39 *
40 * Revision 1.1.1.1  2002/02/01 22:22:36  peiyongz
41 * sane_include
42 *
43 * Revision 1.8  2000/03/02 19:55:35  roddey
44 * This checkin includes many changes done while waiting for the
45 * 1.1.0 code to be finished. I can't list them all here, but a list is
46 * available elsewhere.
47 *
48 * Revision 1.7  2000/02/06 07:48:33  rahulj
49 * Year 2K copyright swat.
50 *
51 * Revision 1.6  2000/01/25 22:49:57  roddey
52 * Moved the supportsSrcOfs() method from the individual transcoder to the
53 * transcoding service, where it should have been to begin with.
54 *
55 * Revision 1.5  2000/01/25 19:19:08  roddey
56 * Simple addition of a getId() method to the xcode and netacess abstractions to
57 * allow each impl to give back an id string.
58 *
59 * Revision 1.4  2000/01/06 01:21:34  aruna1
60 * Transcoding services modified.
61 *
62 * Revision 1.3  2000/01/05 23:30:38  abagchi
63 * Fixed the new class IconvLCPTranscoder functions. Tested on Linux only.
64 *
65 * Revision 1.2  1999/12/18 00:22:32  roddey
66 * Changes to support the new, completely orthagonal, transcoder architecture.
67 *
68 * Revision 1.1.1.1  1999/11/09 01:06:10  twl
69 * Initial checkin
70 *
71 * Revision 1.2  1999/11/08 20:45:34  rahul
72 * Swat for adding in Product name and CVS comment log variable.
73 *
74 */
75
76#ifndef ICONVTRANSSERVICE_HPP
77#define ICONVTRANSSERVICE_HPP
78
79#include <xercesc/util/TransService.hpp>
80
81XERCES_CPP_NAMESPACE_BEGIN
82
83class XMLUTIL_EXPORT IconvTransService : public XMLTransService
84{
85public :
86    // -----------------------------------------------------------------------
87    //  Constructors and Destructor
88    // -----------------------------------------------------------------------
89    IconvTransService();
90    ~IconvTransService();
91
92
93    // -----------------------------------------------------------------------
94    //  Implementation of the virtual transcoding service API
95    // -----------------------------------------------------------------------
96    virtual int compareIString
97    (
98        const   XMLCh* const    comp1
99        , const XMLCh* const    comp2
100    );
101
102    virtual int compareNIString
103    (
104        const   XMLCh* const    comp1
105        , const XMLCh* const    comp2
106        , const unsigned int    maxChars
107    );
108
109    virtual const XMLCh* getId() const;
110
111    virtual bool isSpace(const XMLCh toCheck) const;
112
113    virtual XMLLCPTranscoder* makeNewLCPTranscoder();
114
115    virtual bool supportsSrcOfs() const;
116
117    virtual void upperCase(XMLCh* const toUpperCase) const;
118    virtual void lowerCase(XMLCh* const toLowerCase) const;
119
120protected :
121    // -----------------------------------------------------------------------
122    //  Protected virtual methods
123    // -----------------------------------------------------------------------
124    virtual XMLTranscoder* makeNewXMLTranscoder
125    (
126        const   XMLCh* const            encodingName
127        ,       XMLTransService::Codes& resValue
128        , const unsigned int            blockSize
129        ,       MemoryManager* const    manager
130    );
131
132
133private :
134    // -----------------------------------------------------------------------
135    //  Unimplemented constructors and operators
136    // -----------------------------------------------------------------------
137    IconvTransService(const IconvTransService&);
138    IconvTransService& operator=(const IconvTransService&);
139};
140
141
142class XMLUTIL_EXPORT IconvLCPTranscoder : public XMLLCPTranscoder
143{
144public :
145    // -----------------------------------------------------------------------
146    //  Constructors and Destructor
147    // -----------------------------------------------------------------------
148    IconvLCPTranscoder();
149    ~IconvLCPTranscoder();
150
151
152    // -----------------------------------------------------------------------
153    //  Implementation of the virtual transcoder interface
154    // -----------------------------------------------------------------------
155    virtual unsigned int calcRequiredSize(const char* const srcText
156        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
157
158    virtual unsigned int calcRequiredSize(const XMLCh* const srcText
159        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
160
161    virtual char* transcode(const XMLCh* const toTranscode);
162    virtual char* transcode(const XMLCh* const toTranscode,
163                            MemoryManager* const manager);
164
165    virtual bool transcode
166    (
167        const   XMLCh* const    toTranscode
168        ,       char* const     toFill
169        , const unsigned int    maxBytes
170        , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
171    );
172
173    virtual XMLCh* transcode(const char* const toTranscode);
174    virtual XMLCh* transcode(const char* const toTranscode,
175                             MemoryManager* const manager);
176
177    virtual bool transcode
178    (
179        const   char* const     toTranscode
180        ,       XMLCh* const    toFill
181        , const unsigned int    maxChars
182        , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
183    );
184
185
186private :
187    // -----------------------------------------------------------------------
188    //  Unimplemented constructors and operators
189    // -----------------------------------------------------------------------
190    IconvLCPTranscoder(const IconvLCPTranscoder&);
191    IconvLCPTranscoder& operator=(const IconvLCPTranscoder&);
192};
193
194XERCES_CPP_NAMESPACE_END
195
196#endif
Note: See TracBrowser for help on using the repository browser.