LCOV - code coverage report
Current view: top level - jvmfwk/source - libxmlutil.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 75 83 90.4 %
Date: 2014-04-14 Functions: 24 26 92.3 %
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           1 : CXPathObjectPtr::CXPathObjectPtr(xmlXPathObject* aObject)
      26           1 :     : _object(aObject)
      27             : {
      28           1 : }
      29             : 
      30       85016 : CXPathObjectPtr::CXPathObjectPtr():_object(NULL)
      31             : {
      32       85016 : }
      33             : 
      34       85017 : CXPathObjectPtr::~CXPathObjectPtr()
      35             : {
      36       85017 :     xmlXPathFreeObject(_object);
      37       85017 : }
      38       85016 : CXPathObjectPtr & CXPathObjectPtr::operator = (xmlXPathObject* pObj)
      39             : {
      40       85016 :     if (_object == pObj)
      41           0 :         return *this;
      42             : 
      43       85016 :     xmlXPathFreeObject(_object);
      44       85016 :     _object = pObj;
      45       85016 :     return *this;
      46             : }
      47      340058 : xmlXPathObject* CXPathObjectPtr::operator ->()
      48             : 
      49             : {
      50      340058 :     return _object;
      51             : }
      52           1 : CXPathObjectPtr::operator xmlXPathObject*() const
      53             : {
      54           1 :     return _object;
      55             : }
      56             : 
      57       42505 : CXPathContextPtr::CXPathContextPtr(xmlXPathContextPtr aContext)
      58       42505 :     : _object(aContext)
      59             : {
      60       42505 : }
      61             : 
      62       42506 : CXPathContextPtr::CXPathContextPtr():_object(NULL)
      63             : {
      64       42506 : }
      65             : 
      66       85011 : CXPathContextPtr::~CXPathContextPtr()
      67             : {
      68       85011 :     xmlXPathFreeContext(_object);
      69       85011 : }
      70             : 
      71       42506 : CXPathContextPtr & CXPathContextPtr::operator = (xmlXPathContextPtr pObj)
      72             : {
      73       42506 :     if (_object == pObj)
      74           0 :         return *this;
      75       42506 :     xmlXPathFreeContext(_object);
      76       42506 :     _object = pObj;
      77       42506 :     return *this;
      78             : }
      79           0 : xmlXPathContext* CXPathContextPtr::operator ->()
      80             : {
      81           0 :     return _object;
      82             : }
      83             : 
      84      170028 : CXPathContextPtr::operator xmlXPathContext*() const
      85             : {
      86      170028 :     return _object;
      87             : }
      88             : 
      89      212527 : CXmlDocPtr::CXmlDocPtr(xmlDoc* aDoc)
      90      212527 :     : _object(aDoc)
      91             : {
      92      212527 : }
      93             : 
      94       42506 : CXmlDocPtr::CXmlDocPtr():_object(NULL)
      95             : {
      96       42506 : }
      97             : 
      98      255033 : CXmlDocPtr::~CXmlDocPtr()
      99             : {
     100      255033 :     xmlFreeDoc(_object);
     101      255033 : }
     102       42506 : CXmlDocPtr & CXmlDocPtr::operator = (xmlDoc* pObj)
     103             : {
     104       42506 :     if (_object == pObj)
     105           0 :         return *this;
     106       42506 :     xmlFreeDoc(_object);
     107       42506 :     _object = pObj;
     108       42506 :     return *this;
     109             : }
     110             : 
     111           0 : xmlDoc* CXmlDocPtr::operator ->()
     112             : {
     113           0 :     return _object;
     114             : }
     115             : 
     116      637594 : CXmlDocPtr::operator xmlDoc*() const
     117             : {
     118      637594 :     return _object;
     119             : }
     120             : 
     121             : 
     122          12 : CXmlCharPtr::CXmlCharPtr(xmlChar * aChar)
     123          12 :     : _object(aChar)
     124             : {
     125          12 : }
     126             : 
     127           5 : CXmlCharPtr::CXmlCharPtr(const OUString & s):
     128           5 :     _object(NULL)
     129             : {
     130           5 :     OString o = OUStringToOString(s, RTL_TEXTENCODING_UTF8);
     131           5 :     _object = xmlCharStrdup(o.getStr());
     132           5 : }
     133      892588 : CXmlCharPtr::CXmlCharPtr():_object(NULL)
     134             : {
     135      892588 : }
     136             : 
     137      892605 : CXmlCharPtr::~CXmlCharPtr()
     138             : {
     139      892605 :     xmlFree(_object);
     140      892605 : }
     141             : 
     142     1232628 : CXmlCharPtr & CXmlCharPtr::operator = (xmlChar* pObj)
     143             : {
     144     1232628 :     if (pObj == _object)
     145           0 :         return *this;
     146     1232628 :     xmlFree(_object);
     147     1232628 :     _object = pObj;
     148     1232628 :     return *this;
     149             : }
     150             : 
     151     1530177 : CXmlCharPtr::operator xmlChar*() const
     152             : {
     153     1530177 :     return _object;
     154             : }
     155             : 
     156      467550 : CXmlCharPtr::operator OUString()
     157             : {
     158      467550 :     OUString ret;
     159      467550 :     if (_object != NULL)
     160             :     {
     161      467550 :         OString aOStr((sal_Char*)_object);
     162      467550 :         ret = OStringToOUString(aOStr, RTL_TEXTENCODING_UTF8);
     163             :     }
     164      467550 :     return ret;
     165             : }
     166             : 
     167       85008 : CXmlCharPtr::operator OString()
     168             : {
     169       85008 :     return OString((sal_Char*) _object);
     170             : }
     171             : 
     172             : 
     173             : 
     174             : }
     175             : 
     176             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10