Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

IXMLDOMCharacterDataImpl.h

Go to the documentation of this file.
00001 /* 00002 * Copyright 1999-2000,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 * $Log: IXMLDOMCharacterDataImpl.h,v $ 00019 * Revision 1.5 2004/09/08 13:55:35 peiyongz 00020 * Apache License Version 2.0 00021 * 00022 * Revision 1.4 2004/02/25 18:38:33 amassari 00023 * The COM wrapper doesn't use the deprecated DOM anymore 00024 * 00025 * Revision 1.3 2003/11/21 12:05:48 amassari 00026 * Updated version to 2.4 00027 * 00028 * Revision 1.2 2003/03/14 12:44:49 tng 00029 * [Bug 17147] C++ namespace breaks build of XercesCOM DLL 00030 * 00031 * Revision 1.1.1.1 2002/02/01 22:21:39 peiyongz 00032 * sane_include 00033 * 00034 * Revision 1.3 2000/07/07 00:12:51 jpolast 00035 * bug fixes for non-null terminated strings 00036 * 00037 * Revision 1.2 2000/03/30 02:00:13 abagchi 00038 * Initial checkin of working code with Copyright Notice 00039 * 00040 */ 00041 00042 #ifndef ___ixmldomcharacterdataimpl_h___ 00043 #define ___ixmldomcharacterdataimpl_h___ 00044 00045 #include "IXMLDOMNodeImpl.h" 00046 XERCES_CPP_NAMESPACE_USE 00047 00048 template <class T, const IID* piid, class tihclass = CComTypeInfoHolder> 00049 class ATL_NO_VTABLE IXMLDOMCharacterDataImpl: public IXMLDOMNodeImpl<T,piid,tihclass> 00050 { 00051 public: 00052 00053 virtual DOMCharacterData* get_DOMCharacterData() = 0; 00054 virtual DOMNode* get_DOMNode() { return get_DOMCharacterData(); } 00055 00056 // IXMLDOMCharacterData 00057 00058 STDMETHOD(get_data)(BSTR *pVal) 00059 { 00060 ATLTRACE(_T("IXMLDOMCharacterDataImpl::get_data\n")); 00061 00062 if (NULL == pVal) 00063 return E_POINTER; 00064 00065 *pVal = NULL; 00066 00067 try 00068 { 00069 *pVal = SysAllocString(get_DOMCharacterData()->getData()); 00070 } 00071 catch(...) 00072 { 00073 return E_FAIL; 00074 } 00075 00076 00077 return S_OK; 00078 } 00079 00080 STDMETHOD(put_data)(BSTR newVal) 00081 { 00082 ATLTRACE(_T("IXMLDOMCharacterDataImpl::put_data\n")); 00083 00084 try 00085 { 00086 get_DOMCharacterData()->setData(newVal); 00087 } 00088 catch(...) 00089 { 00090 return E_FAIL; 00091 } 00092 00093 00094 return S_OK; 00095 } 00096 00097 STDMETHOD(get_length)(long *pVal) 00098 { 00099 ATLTRACE(_T("IXMLDOMCharacterDataImpl::get_length\n")); 00100 00101 if (NULL == pVal) 00102 return E_POINTER; 00103 00104 *pVal = 0; 00105 00106 try 00107 { 00108 *pVal = get_DOMCharacterData()->getLength(); 00109 } 00110 catch(...) 00111 { 00112 return E_FAIL; 00113 } 00114 00115 return S_OK; 00116 } 00117 00118 STDMETHOD(substringData)(long offset, long count, BSTR *data) 00119 { 00120 ATLTRACE(_T("IXMLDOMCharacterDataImpl::substringData\n")); 00121 00122 if (NULL == data) 00123 return E_POINTER; 00124 00125 *data = NULL; 00126 00127 try 00128 { 00129 *data = SysAllocString(get_DOMCharacterData()->substringData(offset, count)); 00130 } 00131 catch(...) 00132 { 00133 return E_FAIL; 00134 } 00135 00136 return S_OK; 00137 } 00138 00139 STDMETHOD(appendData)(BSTR data) 00140 { 00141 ATLTRACE(_T("IXMLDOMCharacterDataImpl::appendData\n")); 00142 00143 try 00144 { 00145 get_DOMCharacterData()->appendData(data); 00146 } 00147 catch(...) 00148 { 00149 return E_FAIL; 00150 } 00151 00152 00153 return S_OK; 00154 } 00155 00156 STDMETHOD(insertData)(long offset, BSTR data) 00157 { 00158 ATLTRACE(_T("IXMLDOMCharacterDataImpl::insertData\n")); 00159 00160 try 00161 { 00162 get_DOMCharacterData()->insertData(offset, data); 00163 } 00164 catch(...) 00165 { 00166 return E_FAIL; 00167 } 00168 00169 00170 return S_OK; 00171 } 00172 00173 STDMETHOD(deleteData)(long offset, long count) 00174 { 00175 ATLTRACE(_T("IXMLDOMCharacterDataImpl::deleteData\n")); 00176 00177 try 00178 { 00179 get_DOMCharacterData()->deleteData(offset, count); 00180 } 00181 catch(...) 00182 { 00183 return E_FAIL; 00184 } 00185 00186 00187 return S_OK; 00188 } 00189 00190 STDMETHOD(replaceData)(long offset, long count, BSTR data) 00191 { 00192 ATLTRACE(_T("IXMLDOMCharacterDataImpl::replaceData\n")); 00193 00194 try 00195 { 00196 get_DOMCharacterData()->replaceData(offset, count, data); 00197 } 00198 catch(...) 00199 { 00200 return E_FAIL; 00201 } 00202 00203 return S_OK; 00204 } 00205 00206 }; 00207 00208 #endif // ___ixmldomcharacterdataimpl_h___

Generated on Thu Apr 30 02:30:51 2009 for ACS C++ API by doxygen 1.3.8