secureswitools/swisistools/source/xmlparser/xerces/include/xercesc/util/XMLUTF16Transcoder.hpp
changeset 0 ba25891c3a9e
child 1 c42dffbd5b4f
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 /*
       
    18  * Licensed to the Apache Software Foundation (ASF) under one or more
       
    19  * contributor license agreements.  See the NOTICE file distributed with
       
    20  * this work for additional information regarding copyright ownership.
       
    21  * The ASF licenses this file to You under the Apache License, Version 2.0
       
    22  * (the "License"); you may not use this file except in compliance with
       
    23  * the License.  You may obtain a copy of the License at
       
    24  * 
       
    25  *      http://www.apache.org/licenses/LICENSE-2.0
       
    26  * 
       
    27  * Unless required by applicable law or agreed to in writing, software
       
    28  * distributed under the License is distributed on an "AS IS" BASIS,
       
    29  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       
    30  * See the License for the specific language governing permissions and
       
    31  * limitations under the License.
       
    32  */
       
    33 
       
    34 #ifndef XMLUTF16TRANSCODER_HPP
       
    35 #define XMLUTF16TRANSCODER_HPP
       
    36 
       
    37 #include <xercesc/util/XercesDefs.hpp>
       
    38 #include <xercesc/util/TransService.hpp>
       
    39 
       
    40 XERCES_CPP_NAMESPACE_BEGIN
       
    41 
       
    42 
       
    43 //
       
    44 //  This class provides an implementation of the XMLTranscoder interface
       
    45 //  for a simple UTF16 transcoder. The parser does some encodings
       
    46 //  intrinsically without depending upon external transcoding services.
       
    47 //  To make everything more orthagonal, we implement these internal
       
    48 //  transcoders using the same transcoder abstraction as the pluggable
       
    49 //  transcoding services do.
       
    50 //
       
    51 class XMLUTIL_EXPORT XMLUTF16Transcoder : public XMLTranscoder
       
    52 {
       
    53 public :
       
    54     // -----------------------------------------------------------------------
       
    55     //  Public constructors and destructor
       
    56     // -----------------------------------------------------------------------
       
    57     XMLUTF16Transcoder
       
    58     (
       
    59         const   XMLCh* const    encodingName
       
    60         , const unsigned int    blockSize
       
    61         , const bool            swapped
       
    62         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
       
    63     );
       
    64 
       
    65     virtual ~XMLUTF16Transcoder();
       
    66 
       
    67 
       
    68     // -----------------------------------------------------------------------
       
    69     //  Implementation of the XMLTranscoder interface
       
    70     // -----------------------------------------------------------------------
       
    71     virtual unsigned int transcodeFrom
       
    72     (
       
    73         const   XMLByte* const          srcData
       
    74         , const unsigned int            srcCount
       
    75         ,       XMLCh* const            toFill
       
    76         , const unsigned int            maxChars
       
    77         ,       unsigned int&           bytesEaten
       
    78         ,       unsigned char* const    charSizes
       
    79     );
       
    80 
       
    81     virtual unsigned int transcodeTo
       
    82     (
       
    83         const   XMLCh* const    srcData
       
    84         , const unsigned int    srcCount
       
    85         ,       XMLByte* const  toFill
       
    86         , const unsigned int    maxBytes
       
    87         ,       unsigned int&   charsEaten
       
    88         , const UnRepOpts       options
       
    89     );
       
    90 
       
    91     virtual bool canTranscodeTo
       
    92     (
       
    93         const   unsigned int    toCheck
       
    94     )   const;
       
    95 
       
    96 
       
    97 private :
       
    98     // -----------------------------------------------------------------------
       
    99     //  Unimplemented constructors and operators
       
   100     // -----------------------------------------------------------------------
       
   101     XMLUTF16Transcoder(const XMLUTF16Transcoder&);
       
   102     XMLUTF16Transcoder& operator=(const XMLUTF16Transcoder&);
       
   103 
       
   104 
       
   105     // -----------------------------------------------------------------------
       
   106     //  Private data members
       
   107     //
       
   108     //  fSwapped
       
   109     //      Indicates whether the encoding is of the opposite endianness from
       
   110     //      the local host.
       
   111     // -----------------------------------------------------------------------
       
   112     bool    fSwapped;
       
   113 };
       
   114 
       
   115 XERCES_CPP_NAMESPACE_END
       
   116 
       
   117 #endif