00001 /* 00002 * Copyright 1999-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 #if !defined(ATTRIBUTEVECTORENTRY_HEADER_GUARD_1357924680) 00017 #define ATTRIBUTEVECTORENTRY_HEADER_GUARD_1357924680 00018 00019 00020 00021 // Base include file. Must be first. 00022 #include <xalanc/PlatformSupport/PlatformSupportDefinitions.hpp> 00023 #include <xalanc/PlatformSupport/DOMStringHelper.hpp> 00024 00025 00026 00027 #include <xalanc/Include/XalanVector.hpp> 00028 00029 #include <xalanc/Include/XalanMemMgrAutoPtr.hpp> 00030 00031 00032 XALAN_CPP_NAMESPACE_BEGIN 00033 00034 00035 00036 class XALAN_PLATFORMSUPPORT_EXPORT AttributeVectorEntry 00037 { 00038 public: 00039 00040 typedef XalanVector<XMLCh> XMLChVectorType; 00041 00042 AttributeVectorEntry( 00043 const XMLChVectorType& theName, 00044 const XMLChVectorType& theValue, 00045 const XMLChVectorType& theType, 00046 MemoryManagerType& theManager) : 00047 m_Name(theName,theManager), 00048 m_Value(theValue,theManager), 00049 m_Type(theType,theManager) 00050 { 00051 } 00052 00053 AttributeVectorEntry( 00054 const XMLCh* theName, 00055 const XMLCh* theValue, 00056 const XMLCh* theType, 00057 MemoryManagerType& theManager) : 00058 m_Name(theName, theName + length(theName) + 1, theManager), 00059 m_Value(theValue, theValue + length(theValue) + 1, theManager), 00060 m_Type(theType, theType + length(theType) + 1, theManager) 00061 { 00062 } 00063 00064 AttributeVectorEntry(MemoryManagerType& theManager) : 00065 m_Name(theManager), 00066 m_Value(theManager), 00067 m_Type(theManager) 00068 { 00069 } 00070 00071 static AttributeVectorEntry* 00072 create( const XMLCh* theName, 00073 const XMLCh* theValue, 00074 const XMLCh* theType, 00075 MemoryManagerType& theManager) 00076 { 00077 typedef AttributeVectorEntry ThisType; 00078 00079 XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType))); 00080 00081 ThisType* theResult = theGuard.get(); 00082 00083 new (theResult) ThisType(theName, theValue, theType, theManager); 00084 00085 theGuard.release(); 00086 00087 return theResult; 00088 } 00089 00090 virtual 00091 ~AttributeVectorEntry() 00092 { 00093 } 00094 00095 void 00096 clear() 00097 { 00098 m_Name.clear(); 00099 m_Value.clear(); 00100 m_Type.clear(); 00101 } 00102 00103 XMLChVectorType m_Name; 00104 XMLChVectorType m_Value; 00105 XMLChVectorType m_Type; 00106 00107 // A convenience function to find the length of a null-terminated 00108 // array of XMLChs 00109 static const XMLCh* 00110 endArray(const XMLCh* data) 00111 { 00112 assert(data != 0); 00113 00114 while(*data) 00115 { 00116 ++data; 00117 } 00118 00119 return data; 00120 } 00121 }; 00122 00123 00124 00125 XALAN_CPP_NAMESPACE_END 00126 00127 00128 00129 #endif // ATTRIBUTEVECTORENTRY_HEADER_GUARD_1357924680
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.10 |
|