LCOV - code coverage report
Current view: top level - libreoffice/jvmfwk/source - libxmlutil.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 60 83 72.3 %
Date: 2012-12-17 Functions: 19 26 73.1 %
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         194 : CXPathObjectPtr::CXPathObjectPtr(xmlXPathObject* aObject)
      26         194 :     : _object(aObject)
      27             : {
      28         194 : }
      29             : 
      30        1454 : CXPathObjectPtr::CXPathObjectPtr():_object(NULL)
      31             : {
      32        1454 : }
      33             : 
      34        1648 : CXPathObjectPtr::~CXPathObjectPtr()
      35             : {
      36        1648 :     xmlXPathFreeObject(_object);
      37        1648 : }
      38        1356 : CXPathObjectPtr & CXPathObjectPtr::operator = (xmlXPathObject* pObj)
      39             : {
      40        1356 :     if (_object == pObj)
      41           0 :         return *this;
      42             : 
      43        1356 :     xmlXPathFreeObject(_object);
      44        1356 :     _object = pObj;
      45        1356 :     return *this;
      46             : }
      47        4260 : xmlXPathObject* CXPathObjectPtr::operator ->()
      48             : 
      49             : {
      50        4260 :     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         388 : CXPathContextPtr::CXPathContextPtr():_object(NULL)
      63             : {
      64         388 : }
      65             : 
      66         388 : CXPathContextPtr::~CXPathContextPtr()
      67             : {
      68         388 :     xmlXPathFreeContext(_object);
      69         388 : }
      70             : 
      71         290 : CXPathContextPtr & CXPathContextPtr::operator = (xmlXPathContextPtr pObj)
      72             : {
      73         290 :     if (_object == pObj)
      74           0 :         return *this;
      75         290 :     xmlXPathFreeContext(_object);
      76         290 :     _object = pObj;
      77         290 :     return *this;
      78             : }
      79           0 : xmlXPathContext* CXPathContextPtr::operator ->()
      80             : {
      81           0 :     return _object;
      82             : }
      83             : 
      84        1840 : CXPathContextPtr::operator xmlXPathContext*() const
      85             : {
      86        1840 :     return _object;
      87             : }
      88             : //===========================================================
      89           0 : CXmlDocPtr::CXmlDocPtr(xmlDoc* aDoc)
      90           0 :     : _object(aDoc)
      91             : {
      92           0 : }
      93             : 
      94         388 : CXmlDocPtr::CXmlDocPtr():_object(NULL)
      95             : {
      96         388 : }
      97             : 
      98         388 : CXmlDocPtr::~CXmlDocPtr()
      99             : {
     100         388 :     xmlFreeDoc(_object);
     101         388 : }
     102         290 : CXmlDocPtr & CXmlDocPtr::operator = (xmlDoc* pObj)
     103             : {
     104         290 :     if (_object == pObj)
     105           0 :         return *this;
     106         290 :     xmlFreeDoc(_object);
     107         290 :     _object = pObj;
     108         290 :     return *this;
     109             : }
     110             : 
     111           0 : xmlDoc* CXmlDocPtr::operator ->()
     112             : {
     113           0 :     return _object;
     114             : }
     115             : 
     116        2228 : CXmlDocPtr::operator xmlDoc*() const
     117             : {
     118        2228 :     return _object;
     119             : }
     120             : 
     121             : //===========================================================
     122        2904 : CXmlCharPtr::CXmlCharPtr(xmlChar * aChar)
     123        2904 :     : _object(aChar)
     124             : {
     125        2904 : }
     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         484 : CXmlCharPtr::CXmlCharPtr():_object(NULL)
     134             : {
     135         484 : }
     136             : 
     137        3388 : CXmlCharPtr::~CXmlCharPtr()
     138             : {
     139        3388 :     xmlFree(_object);
     140        3388 : }
     141             : 
     142         484 : CXmlCharPtr & CXmlCharPtr::operator = (xmlChar* pObj)
     143             : {
     144         484 :     if (pObj == _object)
     145           0 :         return *this;
     146         484 :     xmlFree(_object);
     147         484 :     _object = pObj;
     148         484 :     return *this;
     149             : }
     150             : 
     151        1552 : CXmlCharPtr::operator xmlChar*() const
     152             : {
     153        1552 :     return _object;
     154             : }
     155             : 
     156        1836 : CXmlCharPtr::operator ::rtl::OUString()
     157             : {
     158        1836 :     ::rtl::OUString ret;
     159        1836 :     if (_object != NULL)
     160             :     {
     161        1836 :         ::rtl::OString aOStr((sal_Char*)_object);
     162        1836 :         ret = ::rtl::OStringToOUString(aOStr, RTL_TEXTENCODING_UTF8);
     163             :     }
     164        1836 :     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