xref: /aoo41x/main/jvmfwk/source/libxmlutil.hxx (revision 5ac42e1f)
1*5ac42e1fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*5ac42e1fSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*5ac42e1fSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*5ac42e1fSAndrew Rist  * distributed with this work for additional information
6*5ac42e1fSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*5ac42e1fSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*5ac42e1fSAndrew Rist  * "License"); you may not use this file except in compliance
9*5ac42e1fSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*5ac42e1fSAndrew Rist  *
11*5ac42e1fSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*5ac42e1fSAndrew Rist  *
13*5ac42e1fSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*5ac42e1fSAndrew Rist  * software distributed under the License is distributed on an
15*5ac42e1fSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*5ac42e1fSAndrew Rist  * KIND, either express or implied.  See the License for the
17*5ac42e1fSAndrew Rist  * specific language governing permissions and limitations
18*5ac42e1fSAndrew Rist  * under the License.
19*5ac42e1fSAndrew Rist  *
20*5ac42e1fSAndrew Rist  *************************************************************/
21*5ac42e1fSAndrew Rist 
22*5ac42e1fSAndrew Rist 
23cdf0e10cSrcweir #if !defined INCLUDED_JVMFWK_LIBXMLUTIL_HXX
24cdf0e10cSrcweir #define INCLUDED_JVMFWK_LIBXMLUTIL_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "libxml/parser.h"
28cdf0e10cSrcweir #include "libxml/xpath.h"
29cdf0e10cSrcweir //#include "libxml/xpathinternals.h"
30cdf0e10cSrcweir #include "rtl/ustring.hxx"
31cdf0e10cSrcweir namespace jfw
32cdf0e10cSrcweir {
33cdf0e10cSrcweir class CXPathObjectPtr
34cdf0e10cSrcweir {
35cdf0e10cSrcweir     xmlXPathObject* _object;
36cdf0e10cSrcweir     CXPathObjectPtr & operator = (const CXPathObjectPtr&);
37cdf0e10cSrcweir     CXPathObjectPtr(const CXPathObjectPtr&);
38cdf0e10cSrcweir public:
39cdf0e10cSrcweir     CXPathObjectPtr();
40cdf0e10cSrcweir     /** Takes ownership of xmlXPathObject
41cdf0e10cSrcweir      */
42cdf0e10cSrcweir     CXPathObjectPtr(xmlXPathObject* aObject);
43cdf0e10cSrcweir     ~CXPathObjectPtr();
44cdf0e10cSrcweir     /** Takes ownership of xmlXPathObject
45cdf0e10cSrcweir      */
46cdf0e10cSrcweir     CXPathObjectPtr & operator = (xmlXPathObject* pObj);
47cdf0e10cSrcweir     xmlXPathObject* operator -> ();
48cdf0e10cSrcweir     operator xmlXPathObject* ();
49cdf0e10cSrcweir };
50cdf0e10cSrcweir 
51cdf0e10cSrcweir //===========================================================
52cdf0e10cSrcweir class CXPathContextPtr
53cdf0e10cSrcweir {
54cdf0e10cSrcweir     xmlXPathContext* _object;
55cdf0e10cSrcweir 
56cdf0e10cSrcweir     CXPathContextPtr(const jfw::CXPathContextPtr&);
57cdf0e10cSrcweir     CXPathContextPtr & operator = (const CXPathContextPtr&);
58cdf0e10cSrcweir public:
59cdf0e10cSrcweir     CXPathContextPtr();
60cdf0e10cSrcweir     CXPathContextPtr(xmlXPathContextPtr aContext);
61cdf0e10cSrcweir     CXPathContextPtr & operator = (xmlXPathContextPtr pObj);
62cdf0e10cSrcweir     ~CXPathContextPtr();
63cdf0e10cSrcweir     xmlXPathContext* operator -> ();
64cdf0e10cSrcweir     operator xmlXPathContext* ();
65cdf0e10cSrcweir };
66cdf0e10cSrcweir 
67cdf0e10cSrcweir //===========================================================
68cdf0e10cSrcweir class CXmlDocPtr
69cdf0e10cSrcweir {
70cdf0e10cSrcweir     xmlDoc* _object;
71cdf0e10cSrcweir 
72cdf0e10cSrcweir     CXmlDocPtr(const CXmlDocPtr&);
73cdf0e10cSrcweir 
74cdf0e10cSrcweir public:
75cdf0e10cSrcweir     CXmlDocPtr & operator = (const CXmlDocPtr&);
76cdf0e10cSrcweir     CXmlDocPtr();
77cdf0e10cSrcweir     CXmlDocPtr(xmlDoc* aDoc);
78cdf0e10cSrcweir     /** Takes ownership of xmlDoc
79cdf0e10cSrcweir      */
80cdf0e10cSrcweir     CXmlDocPtr & operator = (xmlDoc* pObj);
81cdf0e10cSrcweir     ~CXmlDocPtr();
82cdf0e10cSrcweir     xmlDoc* operator -> ();
83cdf0e10cSrcweir     operator xmlDoc* ();
84cdf0e10cSrcweir };
85cdf0e10cSrcweir 
86cdf0e10cSrcweir //===========================================================
87cdf0e10cSrcweir // class CXmlNsPtr
88cdf0e10cSrcweir // {
89cdf0e10cSrcweir //     xmlNs* _object;
90cdf0e10cSrcweir 
91cdf0e10cSrcweir //     CXmlNsPtr(const CXmlNsPtr&);
92cdf0e10cSrcweir //     CXmlNsPtr & operator = (const CXmlNsPtr&);
93cdf0e10cSrcweir // public:
94cdf0e10cSrcweir //     CXmlNsPtr();
95cdf0e10cSrcweir //     CXmlNsPtr(xmlNs* aDoc);
96cdf0e10cSrcweir //     /** Takes ownership of xmlDoc
97cdf0e10cSrcweir //      */
98cdf0e10cSrcweir //     CXmlNsPtr & operator = (xmlNs* pObj);
99cdf0e10cSrcweir //     ~CXmlNsPtr();
100cdf0e10cSrcweir //     xmlNs* operator -> ();
101cdf0e10cSrcweir //     operator xmlNs* ();
102cdf0e10cSrcweir // };
103cdf0e10cSrcweir 
104cdf0e10cSrcweir //===========================================================
105cdf0e10cSrcweir class CXmlCharPtr
106cdf0e10cSrcweir {
107cdf0e10cSrcweir     xmlChar* _object;
108cdf0e10cSrcweir 
109cdf0e10cSrcweir     CXmlCharPtr(const CXmlCharPtr&);
110cdf0e10cSrcweir     CXmlCharPtr & operator = (const CXmlCharPtr&);
111cdf0e10cSrcweir public:
112cdf0e10cSrcweir     CXmlCharPtr();
113cdf0e10cSrcweir     CXmlCharPtr(xmlChar* aDoc);
114cdf0e10cSrcweir     CXmlCharPtr(const ::rtl::OUString &);
115cdf0e10cSrcweir     ~CXmlCharPtr();
116cdf0e10cSrcweir     CXmlCharPtr & operator = (xmlChar* pObj);
117cdf0e10cSrcweir //    xmlChar* operator -> ();
118cdf0e10cSrcweir     operator xmlChar* ();
119cdf0e10cSrcweir     operator ::rtl::OUString ();
120cdf0e10cSrcweir     operator ::rtl::OString ();
121cdf0e10cSrcweir };
122cdf0e10cSrcweir 
123cdf0e10cSrcweir 
124cdf0e10cSrcweir }
125cdf0e10cSrcweir #endif
126