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