00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one 00003 * or more contributor license agreements. See the NOTICE file 00004 * distributed with this work for additional information 00005 * regarding copyright ownership. The ASF licenses this file 00006 * to you under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 00019 #if !defined(MSG_CREATOR_1357924680) 00020 #define MSG_CREATOR_1357924680 00021 00022 #include "xalanc/Include/PlatformDefinitions.hpp" 00023 00024 #include <xercesc/util/XMLString.hpp> 00025 00026 00027 #include <cstring> 00028 #include <cstdlib> 00029 00030 #if defined(XALAN_CLASSIC_IOSTREAMS) 00031 #include <iostream.h> 00032 #else 00033 #include <iostream> 00034 #endif 00035 00036 XERCES_CPP_NAMESPACE_USE 00037 00038 // --------------------------------------------------------------------------- 00039 // This is a simple class that lets us do easy (though not terribly efficient) 00040 // trancoding of XMLCh data to local code page for display. 00041 // --------------------------------------------------------------------------- 00042 class StrX 00043 { 00044 public : 00045 // ----------------------------------------------------------------------- 00046 // Constructors and Destructor 00047 // ----------------------------------------------------------------------- 00048 StrX(const XMLCh* const toTranscode) 00049 { 00050 XALAN_USING_XERCES(XMLString) 00051 00052 // Call the private transcoding method 00053 fLocalForm = XMLString::transcode(toTranscode); 00054 } 00055 00056 ~StrX() 00057 { 00058 XALAN_USING_XERCES(XMLString) 00059 00060 XMLString::release(&fLocalForm); 00061 } 00062 00063 // ----------------------------------------------------------------------- 00064 // Getter methods 00065 // ----------------------------------------------------------------------- 00066 const char* localForm() const 00067 { 00068 return fLocalForm; 00069 } 00070 00071 private : 00072 // ----------------------------------------------------------------------- 00073 // Private data members 00074 // 00075 // fLocalForm 00076 // This is the local code page form of the string. 00077 // ----------------------------------------------------------------------- 00078 char* fLocalForm; 00079 }; 00080 00081 #if defined(XALAN_CLASSIC_IOSTREAMS) 00082 inline ostream& operator<<(ostream& target, const StrX& toDump) 00083 #else 00084 inline XALAN_STD_QUALIFIER ostream& operator<<(XALAN_STD_QUALIFIER ostream& target, const StrX& toDump) 00085 #endif 00086 { 00087 target << toDump.localForm(); 00088 return target; 00089 } 00090 00091 00092 #endif //MSG_CREATOR_1357924680 00093 00094 00095
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.11 |
|