LCOV - code coverage report
Current view: top level - xmlsecurity/source/xmlsec - xmlelementwrapper_xmlsecimpl.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 38 0.0 %
Date: 2014-04-14 Functions: 0 11 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 <string.h>
      21             : 
      22             : #include "xmlelementwrapper_xmlsecimpl.hxx"
      23             : #include <cppuhelper/supportsservice.hxx>
      24             : #include <cppuhelper/typeprovider.hxx>
      25             : 
      26             : namespace cssu = com::sun::star::uno;
      27             : 
      28             : #define IMPLEMENTATION_NAME "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl"
      29             : 
      30           0 : XMLElementWrapper_XmlSecImpl::XMLElementWrapper_XmlSecImpl(const xmlNodePtr pNode)
      31           0 :     : m_pElement( pNode )
      32             : {
      33           0 : }
      34             : 
      35             : /* XXMLElementWrapper */
      36             : 
      37             : 
      38             : /* XUnoTunnel */
      39           0 : cssu::Sequence< sal_Int8 > XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId( void )
      40             :     throw (cssu::RuntimeException)
      41             : {
      42             :     static ::cppu::OImplementationId* pId = 0;
      43           0 :     if (! pId)
      44             :     {
      45           0 :         ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
      46           0 :         if (! pId)
      47             :         {
      48           0 :             static ::cppu::OImplementationId aId;
      49           0 :             pId = &aId;
      50           0 :         }
      51             :     }
      52           0 :     return pId->getImplementationId();
      53             : }
      54             : 
      55           0 : sal_Int64 SAL_CALL XMLElementWrapper_XmlSecImpl::getSomething( const cssu::Sequence< sal_Int8 >& aIdentifier )
      56             :     throw (cssu::RuntimeException, std::exception)
      57             : {
      58           0 :     if (aIdentifier.getLength() == 16 &&
      59             :         0 == memcmp(
      60           0 :             getUnoTunnelImplementationId().getConstArray(),
      61           0 :             aIdentifier.getConstArray(),
      62           0 :             16 ))
      63             :     {
      64           0 :         return reinterpret_cast < sal_Int64 > ( this );
      65             :     }
      66             :     else
      67             :     {
      68           0 :         return 0;
      69             :     }
      70             : }
      71             : 
      72             : 
      73           0 : OUString XMLElementWrapper_XmlSecImpl_getImplementationName ()
      74             :     throw (cssu::RuntimeException)
      75             : {
      76           0 :     return OUString ( IMPLEMENTATION_NAME );
      77             : }
      78             : 
      79           0 : cssu::Sequence< OUString > SAL_CALL XMLElementWrapper_XmlSecImpl_getSupportedServiceNames(  )
      80             :     throw (cssu::RuntimeException)
      81             : {
      82           0 :     cssu::Sequence < OUString > aRet(1);
      83           0 :     OUString* pArray = aRet.getArray();
      84           0 :     pArray[0] = "com.sun.star.xml.wrapper.XMLElementWrapper";
      85           0 :     return aRet;
      86             : }
      87             : 
      88             : cssu::Reference< cssu::XInterface > SAL_CALL
      89           0 :     XMLElementWrapper_XmlSecImpl_createInstance(
      90             :         const cssu::Reference< cssu::XComponentContext > &)
      91             :     throw( cssu::Exception )
      92             : {
      93           0 :     return (cppu::OWeakObject*) new XMLElementWrapper_XmlSecImpl(NULL);
      94             : }
      95             : 
      96             : /* XServiceInfo */
      97           0 : OUString SAL_CALL XMLElementWrapper_XmlSecImpl::getImplementationName(  )
      98             :     throw (cssu::RuntimeException, std::exception)
      99             : {
     100           0 :     return XMLElementWrapper_XmlSecImpl_getImplementationName();
     101             : }
     102           0 : sal_Bool SAL_CALL XMLElementWrapper_XmlSecImpl::supportsService( const OUString& rServiceName )
     103             :     throw (cssu::RuntimeException, std::exception)
     104             : {
     105           0 :     return cppu::supportsService( this, rServiceName );
     106             : }
     107           0 : cssu::Sequence< OUString > SAL_CALL XMLElementWrapper_XmlSecImpl::getSupportedServiceNames(  )
     108             :     throw (cssu::RuntimeException, std::exception)
     109             : {
     110           0 :     return XMLElementWrapper_XmlSecImpl_getSupportedServiceNames();
     111             : }
     112             : 
     113           0 : xmlNodePtr XMLElementWrapper_XmlSecImpl::getNativeElement(  ) const
     114             : /****** XMLElementWrapper_XmlSecImpl/getNativeElement *************************
     115             :  *
     116             :  *   NAME
     117             :  *  getNativeElement -- Retrieves the libxml2 node wrapped by this object
     118             :  *
     119             :  *   SYNOPSIS
     120             :  *  pNode = getNativeElement();
     121             :  *
     122             :  *   FUNCTION
     123             :  *  see NAME
     124             :  *
     125             :  *   INPUTS
     126             :  *  empty
     127             :  *
     128             :  *   RESULT
     129             :  *  pNode - the libxml2 node wrapped by this object
     130             :  *
     131             :  *   AUTHOR
     132             :  *  Michael Mi
     133             :  *  Email: michael.mi@sun.com
     134             :  ******************************************************************************/
     135             : {
     136           0 :     return m_pElement;
     137             : }
     138             : 
     139           0 : void XMLElementWrapper_XmlSecImpl::setNativeElement(const xmlNodePtr pNode)
     140             : /****** XMLElementWrapper_XmlSecImpl/setNativeElement *************************
     141             :  *
     142             :  *   NAME
     143             :  *  setNativeElement -- Configures the libxml2 node wrapped by this object
     144             :  *
     145             :  *   SYNOPSIS
     146             :  *  setNativeElement( pNode );
     147             :  *
     148             :  *   FUNCTION
     149             :  *  see NAME
     150             :  *
     151             :  *   INPUTS
     152             :  *  pNode - the new libxml2 node to be wrapped by this object
     153             :  *
     154             :  *   RESULT
     155             :  *  empty
     156             :  *
     157             :  *   AUTHOR
     158             :  *  Michael Mi
     159             :  *  Email: michael.mi@sun.com
     160             :  ******************************************************************************/
     161             : {
     162           0 :     m_pElement = pNode;
     163           0 : }
     164             : 
     165             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10