1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #if !defined INCLUDED_JVMFWK_LIBXMLUTIL_HXX 28 #define INCLUDED_JVMFWK_LIBXMLUTIL_HXX 29 30 31 #include "libxml/parser.h" 32 #include "libxml/xpath.h" 33 //#include "libxml/xpathinternals.h" 34 #include "rtl/ustring.hxx" 35 namespace jfw 36 { 37 class CXPathObjectPtr 38 { 39 xmlXPathObject* _object; 40 CXPathObjectPtr & operator = (const CXPathObjectPtr&); 41 CXPathObjectPtr(const CXPathObjectPtr&); 42 public: 43 CXPathObjectPtr(); 44 /** Takes ownership of xmlXPathObject 45 */ 46 CXPathObjectPtr(xmlXPathObject* aObject); 47 ~CXPathObjectPtr(); 48 /** Takes ownership of xmlXPathObject 49 */ 50 CXPathObjectPtr & operator = (xmlXPathObject* pObj); 51 xmlXPathObject* operator -> (); 52 operator xmlXPathObject* (); 53 }; 54 55 //=========================================================== 56 class CXPathContextPtr 57 { 58 xmlXPathContext* _object; 59 60 CXPathContextPtr(const jfw::CXPathContextPtr&); 61 CXPathContextPtr & operator = (const CXPathContextPtr&); 62 public: 63 CXPathContextPtr(); 64 CXPathContextPtr(xmlXPathContextPtr aContext); 65 CXPathContextPtr & operator = (xmlXPathContextPtr pObj); 66 ~CXPathContextPtr(); 67 xmlXPathContext* operator -> (); 68 operator xmlXPathContext* (); 69 }; 70 71 //=========================================================== 72 class CXmlDocPtr 73 { 74 xmlDoc* _object; 75 76 CXmlDocPtr(const CXmlDocPtr&); 77 78 public: 79 CXmlDocPtr & operator = (const CXmlDocPtr&); 80 CXmlDocPtr(); 81 CXmlDocPtr(xmlDoc* aDoc); 82 /** Takes ownership of xmlDoc 83 */ 84 CXmlDocPtr & operator = (xmlDoc* pObj); 85 ~CXmlDocPtr(); 86 xmlDoc* operator -> (); 87 operator xmlDoc* (); 88 }; 89 90 //=========================================================== 91 // class CXmlNsPtr 92 // { 93 // xmlNs* _object; 94 95 // CXmlNsPtr(const CXmlNsPtr&); 96 // CXmlNsPtr & operator = (const CXmlNsPtr&); 97 // public: 98 // CXmlNsPtr(); 99 // CXmlNsPtr(xmlNs* aDoc); 100 // /** Takes ownership of xmlDoc 101 // */ 102 // CXmlNsPtr & operator = (xmlNs* pObj); 103 // ~CXmlNsPtr(); 104 // xmlNs* operator -> (); 105 // operator xmlNs* (); 106 // }; 107 108 //=========================================================== 109 class CXmlCharPtr 110 { 111 xmlChar* _object; 112 113 CXmlCharPtr(const CXmlCharPtr&); 114 CXmlCharPtr & operator = (const CXmlCharPtr&); 115 public: 116 CXmlCharPtr(); 117 CXmlCharPtr(xmlChar* aDoc); 118 CXmlCharPtr(const ::rtl::OUString &); 119 ~CXmlCharPtr(); 120 CXmlCharPtr & operator = (xmlChar* pObj); 121 // xmlChar* operator -> (); 122 operator xmlChar* (); 123 operator ::rtl::OUString (); 124 operator ::rtl::OString (); 125 }; 126 127 128 } 129 #endif 130