http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Home

Readme
Charter
Release Info

Installation
Download
Build Instructions

FAQs
Samples
API Docs

DOM C++ Binding
Programming
Migration Guide

Feedback
Bug-Reporting
PDF Document

Source Repository
User Mail Archive
Devel Mail Archive

API Docs for SAX and DOM
 

HexBin.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2001,2004 The Apache Software Foundation.
00003  * 
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  * 
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  * 
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 /*
00018  * $Id: HexBin.hpp 176236 2004-12-10 10:37:56Z cargilld $
00019  */
00020 
00021 #ifndef HEXBIN_HPP
00022 #define HEXBIN_HPP
00023 
00024 #include <xercesc/util/PlatformUtils.hpp>
00025 
00026 XERCES_CPP_NAMESPACE_BEGIN
00027 
00028 class  HexBin
00029 {
00030 public :
00032 
00042     static int  getDataLength(const XMLCh* const hexData);
00043 
00053     static bool isArrayByteHex(const XMLCh* const hexData);
00054 
00069     static XMLCh* getCanonicalRepresentation
00070                   (
00071                       const XMLCh*          const hexData
00072                     ,       MemoryManager*  const manager = XMLPlatformUtils::fgMemoryManager
00073                   );
00074 
00093     static XMLCh* decode(
00094                          const XMLCh*          const    hexData
00095                        ,       MemoryManager*  const    manager = XMLPlatformUtils::fgMemoryManager
00096                         );
00097 
00114     static XMLByte* decodeToXMLByte(
00115                          const XMLCh*          const    hexData
00116                        ,       MemoryManager*  const    manager = XMLPlatformUtils::fgMemoryManager
00117                         );
00118 
00119 
00121 
00122 private :
00123 
00124     // -----------------------------------------------------------------------
00125     //  Helper methods
00126     // -----------------------------------------------------------------------
00127 
00128     static void init();
00129 
00130     static bool isHex(const XMLCh& octect);
00131 
00132     // -----------------------------------------------------------------------
00133     //  Unimplemented constructors and operators
00134     // -----------------------------------------------------------------------
00135     HexBin();
00136     HexBin(const HexBin&);
00137     HexBin& operator=(const HexBin&);
00138 
00139     // -----------------------------------------------------------------------
00140     //  Private data members
00141     //
00142     //  isInitialized
00143     //
00144     //     set once hexNumberTable is initalized.
00145     //
00146     //  hexNumberTable
00147     //
00148     //     arrany holding valid hexNumber character.
00149     //
00150     // -----------------------------------------------------------------------
00151     static bool       isInitialized;
00152     static XMLByte    hexNumberTable[];
00153 };
00154 
00155 XERCES_CPP_NAMESPACE_END
00156 
00157 #endif


Copyright © 1994-2004 The Apache Software Foundation. All Rights Reserved.