LibreOffice Module jvmfwk (master)
1
jvmfwk
source
libxmlutil.cxx
Go to the documentation of this file.
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
20
#include <
libxmlutil.hxx
>
21
22
namespace
jfw
23
{
24
25
CXPathObjectPtr::CXPathObjectPtr
():_object(nullptr)
26
{
27
}
28
CXPathObjectPtr::CXPathObjectPtr
(xmlXPathObject* pObj):_object(pObj)
29
{
30
}
31
CXPathObjectPtr::~CXPathObjectPtr
()
32
{
33
xmlXPathFreeObject(
_object
);
34
}
35
CXPathObjectPtr
&
CXPathObjectPtr::operator =
(xmlXPathObject* pObj)
36
{
37
if
(
_object
== pObj)
38
return
*
this
;
39
40
xmlXPathFreeObject(
_object
);
41
_object
= pObj;
42
return
*
this
;
43
}
44
45
CXPathContextPtr::CXPathContextPtr
(xmlXPathContextPtr aContext)
46
: _object(aContext)
47
{
48
}
49
50
CXPathContextPtr::CXPathContextPtr
():_object(nullptr)
51
{
52
}
53
54
CXPathContextPtr::~CXPathContextPtr
()
55
{
56
xmlXPathFreeContext(
_object
);
57
}
58
59
CXPathContextPtr
&
CXPathContextPtr::operator =
(xmlXPathContextPtr pObj)
60
{
61
if
(
_object
== pObj)
62
return
*
this
;
63
xmlXPathFreeContext(
_object
);
64
_object
= pObj;
65
return
*
this
;
66
}
67
68
69
CXmlDocPtr::CXmlDocPtr
(xmlDoc* aDoc)
70
: _object(aDoc)
71
{
72
}
73
74
CXmlDocPtr::CXmlDocPtr
():_object(nullptr)
75
{
76
}
77
78
CXmlDocPtr::~CXmlDocPtr
()
79
{
80
xmlFreeDoc(
_object
);
81
}
82
CXmlDocPtr
&
CXmlDocPtr::operator =
(xmlDoc* pObj)
83
{
84
if
(
_object
== pObj)
85
return
*
this
;
86
xmlFreeDoc(
_object
);
87
_object
= pObj;
88
return
*
this
;
89
}
90
91
92
CXmlCharPtr::CXmlCharPtr
(xmlChar * aChar)
93
: _object(aChar)
94
{
95
}
96
97
CXmlCharPtr::CXmlCharPtr
(std::u16string_view s):
98
_object(nullptr)
99
{
100
OString o =
OUStringToOString
(s, RTL_TEXTENCODING_UTF8);
101
_object
= xmlCharStrdup(o.getStr());
102
}
103
CXmlCharPtr::CXmlCharPtr
():_object(nullptr)
104
{
105
}
106
107
CXmlCharPtr::~CXmlCharPtr
()
108
{
109
xmlFree(
_object
);
110
}
111
112
CXmlCharPtr
&
CXmlCharPtr::operator =
(xmlChar* pObj)
113
{
114
if
(pObj ==
_object
)
115
return
*
this
;
116
xmlFree(
_object
);
117
_object
= pObj;
118
return
*
this
;
119
}
120
121
122
CXmlCharPtr::operator OUString()
123
{
124
OUString ret;
125
if
(_object !=
nullptr
)
126
{
127
std::string_view aOStr(
reinterpret_cast<
char
*
>
(_object));
128
ret = OStringToOUString(aOStr, RTL_TEXTENCODING_UTF8);
129
}
130
return
ret;
131
}
132
133
134
}
135
136
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
jfw::CXPathContextPtr
Definition:
libxmlutil.hxx:50
jfw::CXPathContextPtr::operator=
CXPathContextPtr & operator=(const CXPathContextPtr &)=delete
jfw::CXPathContextPtr::~CXPathContextPtr
~CXPathContextPtr()
Definition:
libxmlutil.cxx:54
jfw::CXPathContextPtr::CXPathContextPtr
CXPathContextPtr()
Definition:
libxmlutil.cxx:50
jfw::CXPathContextPtr::_object
xmlXPathContext * _object
Definition:
libxmlutil.hxx:51
jfw::CXPathObjectPtr
Definition:
libxmlutil.hxx:33
jfw::CXPathObjectPtr::~CXPathObjectPtr
~CXPathObjectPtr()
Definition:
libxmlutil.cxx:31
jfw::CXPathObjectPtr::CXPathObjectPtr
CXPathObjectPtr()
Definition:
libxmlutil.cxx:25
jfw::CXPathObjectPtr::operator=
CXPathObjectPtr & operator=(const CXPathObjectPtr &)=delete
jfw::CXPathObjectPtr::_object
xmlXPathObject * _object
Definition:
libxmlutil.hxx:34
jfw::CXmlCharPtr
Definition:
libxmlutil.hxx:82
jfw::CXmlCharPtr::CXmlCharPtr
CXmlCharPtr()
Definition:
libxmlutil.cxx:103
jfw::CXmlCharPtr::operator=
CXmlCharPtr & operator=(const CXmlCharPtr &)=delete
jfw::CXmlCharPtr::_object
xmlChar * _object
Definition:
libxmlutil.hxx:83
jfw::CXmlCharPtr::~CXmlCharPtr
~CXmlCharPtr()
Definition:
libxmlutil.cxx:107
jfw::CXmlDocPtr
Definition:
libxmlutil.hxx:65
jfw::CXmlDocPtr::operator=
CXmlDocPtr & operator=(const CXmlDocPtr &)
jfw::CXmlDocPtr::~CXmlDocPtr
~CXmlDocPtr()
Definition:
libxmlutil.cxx:78
jfw::CXmlDocPtr::CXmlDocPtr
CXmlDocPtr()
Definition:
libxmlutil.cxx:74
jfw::CXmlDocPtr::_object
xmlDoc * _object
Definition:
libxmlutil.hxx:66
libxmlutil.hxx
jfw
Definition:
elements.cxx:47
OUStringToOString
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
Generated on Sun Jul 30 2023 04:26:54 for LibreOffice Module jvmfwk (master) by
1.9.3