Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef INCLUDED_JVMFWK_SOURCE_LIBXMLUTIL_HXX
20 : #define INCLUDED_JVMFWK_SOURCE_LIBXMLUTIL_HXX
21 :
22 : #include "libxml/parser.h"
23 : #include "libxml/xpath.h"
24 : #include "rtl/ustring.hxx"
25 :
26 : namespace jfw
27 : {
28 : class CXPathObjectPtr
29 : {
30 : xmlXPathObject* _object;
31 : CXPathObjectPtr & operator = (const CXPathObjectPtr&);
32 : CXPathObjectPtr(const CXPathObjectPtr&);
33 : public:
34 : CXPathObjectPtr();
35 : /** Takes ownership of xmlXPathObject
36 : */
37 : CXPathObjectPtr(xmlXPathObject* aObject);
38 : ~CXPathObjectPtr();
39 : /** Takes ownership of xmlXPathObject
40 : */
41 : CXPathObjectPtr & operator = (xmlXPathObject* pObj);
42 2104 : xmlXPathObject* operator -> () { return _object;}
43 2 : operator xmlXPathObject* () const { return _object;}
44 : };
45 :
46 :
47 : class CXPathContextPtr
48 : {
49 : xmlXPathContext* _object;
50 :
51 : CXPathContextPtr(const jfw::CXPathContextPtr&);
52 : CXPathContextPtr & operator = (const CXPathContextPtr&);
53 : public:
54 : CXPathContextPtr();
55 : CXPathContextPtr(xmlXPathContextPtr aContext);
56 : CXPathContextPtr & operator = (xmlXPathContextPtr pObj);
57 : ~CXPathContextPtr();
58 : xmlXPathContext* operator -> () { return _object;}
59 1052 : operator xmlXPathContext* () const { return _object;}
60 : };
61 :
62 :
63 : class CXmlDocPtr
64 : {
65 : xmlDoc* _object;
66 :
67 : CXmlDocPtr(const CXmlDocPtr&);
68 :
69 : public:
70 : CXmlDocPtr & operator = (const CXmlDocPtr&);
71 : CXmlDocPtr();
72 : CXmlDocPtr(xmlDoc* aDoc);
73 : /** Takes ownership of xmlDoc
74 : */
75 : CXmlDocPtr & operator = (xmlDoc* pObj);
76 : ~CXmlDocPtr();
77 : xmlDoc* operator -> () { return _object;}
78 814 : operator xmlDoc* () const { return _object;}
79 : };
80 :
81 :
82 : class CXmlCharPtr
83 : {
84 : xmlChar* _object;
85 :
86 : CXmlCharPtr(const CXmlCharPtr&);
87 : CXmlCharPtr & operator = (const CXmlCharPtr&);
88 : public:
89 : CXmlCharPtr();
90 : CXmlCharPtr(xmlChar* aDoc);
91 : CXmlCharPtr(const OUString &);
92 : ~CXmlCharPtr();
93 : CXmlCharPtr & operator = (xmlChar* pObj);
94 550 : operator xmlChar* () const { return _object;}
95 : operator OUString ();
96 16 : operator OString () { return OString((sal_Char*) _object);}
97 : };
98 :
99 :
100 : }
101 : #endif
102 :
103 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|