[2674] | 1 | /* |
---|
| 2 | * Licensed to the Apache Software Foundation (ASF) under one or more |
---|
| 3 | * contributor license agreements. See the NOTICE file distributed with |
---|
| 4 | * this work for additional information regarding copyright ownership. |
---|
| 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
---|
| 6 | * (the "License"); you may not use this file except in compliance with |
---|
| 7 | * the License. You may obtain a copy of the License at |
---|
| 8 | * |
---|
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
---|
| 10 | * |
---|
| 11 | * Unless required by applicable law or agreed to in writing, software |
---|
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
---|
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
| 14 | * See the License for the specific language governing permissions and |
---|
| 15 | * limitations under the License. |
---|
| 16 | */ |
---|
| 17 | |
---|
| 18 | /* |
---|
| 19 | * $Id: IconvTransService.hpp 568078 2007-08-21 11:43:25Z amassari $ |
---|
| 20 | */ |
---|
| 21 | |
---|
| 22 | #ifndef ICONVTRANSSERVICE_HPP |
---|
| 23 | #define ICONVTRANSSERVICE_HPP |
---|
| 24 | |
---|
| 25 | #include <xercesc/util/TransService.hpp> |
---|
| 26 | |
---|
| 27 | XERCES_CPP_NAMESPACE_BEGIN |
---|
| 28 | |
---|
| 29 | class XMLUTIL_EXPORT IconvTransService : public XMLTransService |
---|
| 30 | { |
---|
| 31 | public : |
---|
| 32 | // ----------------------------------------------------------------------- |
---|
| 33 | // Constructors and Destructor |
---|
| 34 | // ----------------------------------------------------------------------- |
---|
| 35 | IconvTransService(); |
---|
| 36 | ~IconvTransService(); |
---|
| 37 | |
---|
| 38 | |
---|
| 39 | // ----------------------------------------------------------------------- |
---|
| 40 | // Implementation of the virtual transcoding service API |
---|
| 41 | // ----------------------------------------------------------------------- |
---|
| 42 | virtual int compareIString |
---|
| 43 | ( |
---|
| 44 | const XMLCh* const comp1 |
---|
| 45 | , const XMLCh* const comp2 |
---|
| 46 | ); |
---|
| 47 | |
---|
| 48 | virtual int compareNIString |
---|
| 49 | ( |
---|
| 50 | const XMLCh* const comp1 |
---|
| 51 | , const XMLCh* const comp2 |
---|
| 52 | , const unsigned int maxChars |
---|
| 53 | ); |
---|
| 54 | |
---|
| 55 | virtual const XMLCh* getId() const; |
---|
| 56 | |
---|
| 57 | virtual bool isSpace(const XMLCh toCheck) const; |
---|
| 58 | |
---|
| 59 | virtual XMLLCPTranscoder* makeNewLCPTranscoder(); |
---|
| 60 | |
---|
| 61 | virtual bool supportsSrcOfs() const; |
---|
| 62 | |
---|
| 63 | virtual void upperCase(XMLCh* const toUpperCase) const; |
---|
| 64 | virtual void lowerCase(XMLCh* const toLowerCase) const; |
---|
| 65 | |
---|
| 66 | protected : |
---|
| 67 | // ----------------------------------------------------------------------- |
---|
| 68 | // Protected virtual methods |
---|
| 69 | // ----------------------------------------------------------------------- |
---|
| 70 | virtual XMLTranscoder* makeNewXMLTranscoder |
---|
| 71 | ( |
---|
| 72 | const XMLCh* const encodingName |
---|
| 73 | , XMLTransService::Codes& resValue |
---|
| 74 | , const unsigned int blockSize |
---|
| 75 | , MemoryManager* const manager |
---|
| 76 | ); |
---|
| 77 | |
---|
| 78 | |
---|
| 79 | private : |
---|
| 80 | // ----------------------------------------------------------------------- |
---|
| 81 | // Unimplemented constructors and operators |
---|
| 82 | // ----------------------------------------------------------------------- |
---|
| 83 | IconvTransService(const IconvTransService&); |
---|
| 84 | IconvTransService& operator=(const IconvTransService&); |
---|
| 85 | }; |
---|
| 86 | |
---|
| 87 | |
---|
| 88 | class XMLUTIL_EXPORT IconvLCPTranscoder : public XMLLCPTranscoder |
---|
| 89 | { |
---|
| 90 | public : |
---|
| 91 | // ----------------------------------------------------------------------- |
---|
| 92 | // Constructors and Destructor |
---|
| 93 | // ----------------------------------------------------------------------- |
---|
| 94 | IconvLCPTranscoder(); |
---|
| 95 | ~IconvLCPTranscoder(); |
---|
| 96 | |
---|
| 97 | |
---|
| 98 | // ----------------------------------------------------------------------- |
---|
| 99 | // Implementation of the virtual transcoder interface |
---|
| 100 | // ----------------------------------------------------------------------- |
---|
| 101 | virtual unsigned int calcRequiredSize(const char* const srcText |
---|
| 102 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); |
---|
| 103 | |
---|
| 104 | virtual unsigned int calcRequiredSize(const XMLCh* const srcText |
---|
| 105 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); |
---|
| 106 | |
---|
| 107 | virtual char* transcode(const XMLCh* const toTranscode); |
---|
| 108 | virtual char* transcode(const XMLCh* const toTranscode, |
---|
| 109 | MemoryManager* const manager); |
---|
| 110 | |
---|
| 111 | virtual bool transcode |
---|
| 112 | ( |
---|
| 113 | const XMLCh* const toTranscode |
---|
| 114 | , char* const toFill |
---|
| 115 | , const unsigned int maxBytes |
---|
| 116 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager |
---|
| 117 | ); |
---|
| 118 | |
---|
| 119 | virtual XMLCh* transcode(const char* const toTranscode); |
---|
| 120 | virtual XMLCh* transcode(const char* const toTranscode, |
---|
| 121 | MemoryManager* const manager); |
---|
| 122 | |
---|
| 123 | virtual bool transcode |
---|
| 124 | ( |
---|
| 125 | const char* const toTranscode |
---|
| 126 | , XMLCh* const toFill |
---|
| 127 | , const unsigned int maxChars |
---|
| 128 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager |
---|
| 129 | ); |
---|
| 130 | |
---|
| 131 | |
---|
| 132 | private : |
---|
| 133 | // ----------------------------------------------------------------------- |
---|
| 134 | // Unimplemented constructors and operators |
---|
| 135 | // ----------------------------------------------------------------------- |
---|
| 136 | IconvLCPTranscoder(const IconvLCPTranscoder&); |
---|
| 137 | IconvLCPTranscoder& operator=(const IconvLCPTranscoder&); |
---|
| 138 | }; |
---|
| 139 | |
---|
| 140 | XERCES_CPP_NAMESPACE_END |
---|
| 141 | |
---|
| 142 | #endif |
---|