LCOV - code coverage report
Current view: top level - libreoffice/ucb/source/ucp/file - filid.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 22 42 52.4 %
Date: 2012-12-27 Functions: 7 10 70.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 "filid.hxx"
      21             : #include "shell.hxx"
      22             : 
      23             : using namespace fileaccess;
      24             : using namespace com::sun::star;
      25             : using namespace com::sun::star::ucb;
      26             : 
      27             : 
      28       17419 : FileContentIdentifier::FileContentIdentifier(
      29             :     shell* pMyShell,
      30             :     const rtl::OUString& aUnqPath,
      31             :     sal_Bool IsNormalized )
      32       17419 :     : m_pMyShell( pMyShell )
      33             : {
      34       17419 :     if( IsNormalized )
      35             :     {
      36         362 :         m_pMyShell->getUrlFromUnq( aUnqPath,m_aContentId );
      37         362 :         m_aNormalizedId = aUnqPath;
      38         362 :         m_pMyShell->getScheme( m_aProviderScheme );
      39             :     }
      40             :     else
      41             :     {
      42       17057 :         m_pMyShell->getUnqFromUrl( aUnqPath,m_aNormalizedId );
      43       17057 :         m_aContentId = aUnqPath;
      44       17057 :         m_pMyShell->getScheme( m_aProviderScheme );
      45             :     }
      46       17419 : }
      47             : 
      48       34306 : FileContentIdentifier::~FileContentIdentifier()
      49             : {
      50       34306 : }
      51             : 
      52             : 
      53             : void SAL_CALL
      54       55880 : FileContentIdentifier::acquire(
      55             :     void )
      56             :     throw()
      57             : {
      58       55880 :     OWeakObject::acquire();
      59       55880 : }
      60             : 
      61             : 
      62             : void SAL_CALL
      63       55614 : FileContentIdentifier::release(
      64             :                 void )
      65             :   throw()
      66             : {
      67       55614 :   OWeakObject::release();
      68       55614 : }
      69             : 
      70             : 
      71             : uno::Any SAL_CALL
      72           0 : FileContentIdentifier::queryInterface(
      73             :     const uno::Type& rType )
      74             :     throw( uno::RuntimeException )
      75             : {
      76             :     uno::Any aRet = cppu::queryInterface( rType,
      77             :                                           (static_cast< lang::XTypeProvider* >(this)),
      78           0 :                                           (static_cast< XContentIdentifier* >(this)) );
      79           0 :     return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
      80             : }
      81             : 
      82             : 
      83             : uno::Sequence< sal_Int8 > SAL_CALL
      84           0 : FileContentIdentifier::getImplementationId()
      85             :     throw( uno::RuntimeException )
      86             : {
      87             :     static cppu::OImplementationId* pId = NULL;
      88           0 :     if ( !pId )
      89             :     {
      90           0 :         osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
      91           0 :         if ( !pId )
      92             :         {
      93           0 :             static cppu::OImplementationId id( sal_False );
      94           0 :             pId = &id;
      95           0 :         }
      96             :     }
      97           0 :     return (*pId).getImplementationId();
      98             : }
      99             : 
     100             : 
     101             : uno::Sequence< uno::Type > SAL_CALL
     102           0 : FileContentIdentifier::getTypes(
     103             :     void )
     104             :     throw( uno::RuntimeException )
     105             : {
     106             :     static cppu::OTypeCollection* pCollection = NULL;
     107           0 :     if ( !pCollection ) {
     108           0 :         osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
     109           0 :         if ( !pCollection )
     110             :         {
     111             :             static cppu::OTypeCollection collection(
     112           0 :                 getCppuType( static_cast< uno::Reference< lang::XTypeProvider >* >( 0 ) ),
     113           0 :                 getCppuType( static_cast< uno::Reference< XContentIdentifier >* >( 0 ) ) );
     114           0 :             pCollection = &collection;
     115           0 :         }
     116             :     }
     117           0 :     return (*pCollection).getTypes();
     118             : }
     119             : 
     120             : 
     121             : rtl::OUString
     122             : SAL_CALL
     123       35422 : FileContentIdentifier::getContentIdentifier(
     124             :     void )
     125             :     throw( uno::RuntimeException )
     126             : {
     127       35422 :     return m_aContentId;
     128             : }
     129             : 
     130             : 
     131             : rtl::OUString SAL_CALL
     132        4333 : FileContentIdentifier::getContentProviderScheme(
     133             :     void )
     134             :     throw( uno::RuntimeException )
     135             : {
     136        4333 :     return m_aProviderScheme;
     137             : }
     138             : 
     139             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10