LCOV - code coverage report
Current view: top level - libreoffice/jvmfwk/source - libxmlutil.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 83 0.0 %
Date: 2012-12-27 Functions: 0 26 0.0 %
Legend: Lines: hit not hit

          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             : 
      20             : #include "libxmlutil.hxx"
      21             : 
      22             : namespace jfw
      23             : {
      24             : 
      25           0 : CXPathObjectPtr::CXPathObjectPtr(xmlXPathObject* aObject)
      26           0 :     : _object(aObject)
      27             : {
      28           0 : }
      29             : 
      30           0 : CXPathObjectPtr::CXPathObjectPtr():_object(NULL)
      31             : {
      32           0 : }
      33             : 
      34           0 : CXPathObjectPtr::~CXPathObjectPtr()
      35             : {
      36           0 :     xmlXPathFreeObject(_object);
      37           0 : }
      38           0 : CXPathObjectPtr & CXPathObjectPtr::operator = (xmlXPathObject* pObj)
      39             : {
      40           0 :     if (_object == pObj)
      41           0 :         return *this;
      42             : 
      43           0 :     xmlXPathFreeObject(_object);
      44           0 :     _object = pObj;
      45           0 :     return *this;
      46             : }
      47           0 : xmlXPathObject* CXPathObjectPtr::operator ->()
      48             : 
      49             : {
      50           0 :     return _object;
      51             : }
      52           0 : CXPathObjectPtr::operator xmlXPathObject*() const
      53             : {
      54           0 :     return _object;
      55             : }
      56             : //===========================================================
      57           0 : CXPathContextPtr::CXPathContextPtr(xmlXPathContextPtr aContext)
      58           0 :     : _object(aContext)
      59             : {
      60           0 : }
      61             : 
      62           0 : CXPathContextPtr::CXPathContextPtr():_object(NULL)
      63             : {
      64           0 : }
      65             : 
      66           0 : CXPathContextPtr::~CXPathContextPtr()
      67             : {
      68           0 :     xmlXPathFreeContext(_object);
      69           0 : }
      70             : 
      71           0 : CXPathContextPtr & CXPathContextPtr::operator = (xmlXPathContextPtr pObj)
      72             : {
      73           0 :     if (_object == pObj)
      74           0 :         return *this;
      75           0 :     xmlXPathFreeContext(_object);
      76           0 :     _object = pObj;
      77           0 :     return *this;
      78             : }
      79           0 : xmlXPathContext* CXPathContextPtr::operator ->()
      80             : {
      81           0 :     return _object;
      82             : }
      83             : 
      84           0 : CXPathContextPtr::operator xmlXPathContext*() const
      85             : {
      86           0 :     return _object;
      87             : }
      88             : //===========================================================
      89           0 : CXmlDocPtr::CXmlDocPtr(xmlDoc* aDoc)
      90           0 :     : _object(aDoc)
      91             : {
      92           0 : }
      93             : 
      94           0 : CXmlDocPtr::CXmlDocPtr():_object(NULL)
      95             : {
      96           0 : }
      97             : 
      98           0 : CXmlDocPtr::~CXmlDocPtr()
      99             : {
     100           0 :     xmlFreeDoc(_object);
     101           0 : }
     102           0 : CXmlDocPtr & CXmlDocPtr::operator = (xmlDoc* pObj)
     103             : {
     104           0 :     if (_object == pObj)
     105           0 :         return *this;
     106           0 :     xmlFreeDoc(_object);
     107           0 :     _object = pObj;
     108           0 :     return *this;
     109             : }
     110             : 
     111           0 : xmlDoc* CXmlDocPtr::operator ->()
     112             : {
     113           0 :     return _object;
     114             : }
     115             : 
     116           0 : CXmlDocPtr::operator xmlDoc*() const
     117             : {
     118           0 :     return _object;
     119             : }
     120             : 
     121             : //===========================================================
     122           0 : CXmlCharPtr::CXmlCharPtr(xmlChar * aChar)
     123           0 :     : _object(aChar)
     124             : {
     125           0 : }
     126             : 
     127           0 : CXmlCharPtr::CXmlCharPtr(const ::rtl::OUString & s):
     128           0 :     _object(NULL)
     129             : {
     130           0 :     ::rtl::OString o = ::rtl::OUStringToOString(s, RTL_TEXTENCODING_UTF8);
     131           0 :     _object = xmlCharStrdup(o.getStr());
     132           0 : }
     133           0 : CXmlCharPtr::CXmlCharPtr():_object(NULL)
     134             : {
     135           0 : }
     136             : 
     137           0 : CXmlCharPtr::~CXmlCharPtr()
     138             : {
     139           0 :     xmlFree(_object);
     140           0 : }
     141             : 
     142           0 : CXmlCharPtr & CXmlCharPtr::operator = (xmlChar* pObj)
     143             : {
     144           0 :     if (pObj == _object)
     145           0 :         return *this;
     146           0 :     xmlFree(_object);
     147           0 :     _object = pObj;
     148           0 :     return *this;
     149             : }
     150             : 
     151           0 : CXmlCharPtr::operator xmlChar*() const
     152             : {
     153           0 :     return _object;
     154             : }
     155             : 
     156           0 : CXmlCharPtr::operator ::rtl::OUString()
     157             : {
     158           0 :     ::rtl::OUString ret;
     159           0 :     if (_object != NULL)
     160             :     {
     161           0 :         ::rtl::OString aOStr((sal_Char*)_object);
     162           0 :         ret = ::rtl::OStringToOUString(aOStr, RTL_TEXTENCODING_UTF8);
     163             :     }
     164           0 :     return ret;
     165             : }
     166             : 
     167           0 : CXmlCharPtr::operator ::rtl::OString()
     168             : {
     169           0 :     return ::rtl::OString((sal_Char*) _object);
     170             : }
     171             : 
     172             : 
     173             : 
     174             : }
     175             : 
     176             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10