1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "libxmlutil.hxx"
25 CXPathObjectPtr::CXPathObjectPtr():_object(NULL
)
29 CXPathObjectPtr::~CXPathObjectPtr()
31 xmlXPathFreeObject(_object
);
33 CXPathObjectPtr
& CXPathObjectPtr::operator = (xmlXPathObject
* pObj
)
38 xmlXPathFreeObject(_object
);
43 CXPathContextPtr::CXPathContextPtr(xmlXPathContextPtr aContext
)
48 CXPathContextPtr::CXPathContextPtr():_object(NULL
)
52 CXPathContextPtr::~CXPathContextPtr()
54 xmlXPathFreeContext(_object
);
57 CXPathContextPtr
& CXPathContextPtr::operator = (xmlXPathContextPtr pObj
)
61 xmlXPathFreeContext(_object
);
67 CXmlDocPtr::CXmlDocPtr(xmlDoc
* aDoc
)
72 CXmlDocPtr::CXmlDocPtr():_object(NULL
)
76 CXmlDocPtr::~CXmlDocPtr()
80 CXmlDocPtr
& CXmlDocPtr::operator = (xmlDoc
* pObj
)
92 CXmlCharPtr::CXmlCharPtr(xmlChar
* aChar
)
97 CXmlCharPtr::CXmlCharPtr(const OUString
& s
):
100 OString o
= OUStringToOString(s
, RTL_TEXTENCODING_UTF8
);
101 _object
= xmlCharStrdup(o
.getStr());
103 CXmlCharPtr::CXmlCharPtr():_object(NULL
)
107 CXmlCharPtr::~CXmlCharPtr()
112 CXmlCharPtr
& CXmlCharPtr::operator = (xmlChar
* pObj
)
122 CXmlCharPtr::operator OUString()
127 OString
aOStr(reinterpret_cast<char*>(_object
));
128 ret
= OStringToOUString(aOStr
, RTL_TEXTENCODING_UTF8
);
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */