LCOV - code coverage report
Current view: top level - desktop/source/deployment/inc - dp_ucb.h (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 8 8 100.0 %
Date: 2012-08-25 Functions: 3 3 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 4 8 50.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #ifndef INCLUDED_DP_UCB_H
      30                 :            : #define INCLUDED_DP_UCB_H
      31                 :            : 
      32                 :            : #include <list>
      33                 :            : #include "rtl/byteseq.hxx"
      34                 :            : #include "rtl/instance.hxx"
      35                 :            : #include "com/sun/star/sdbc/XResultSet.hpp"
      36                 :            : #include "com/sun/star/ucb/XCommandEnvironment.hpp"
      37                 :            : #include "dp_misc_api.hxx"
      38                 :            : #include "ucbhelper/content.hxx"
      39                 :            : 
      40                 :            : namespace ucbhelper
      41                 :            : {
      42                 :            : class Content;
      43                 :            : }
      44                 :            : 
      45                 :            : namespace css = ::com::sun::star;
      46                 :            : 
      47                 :            : namespace dp_misc {
      48                 :            : 
      49                 :            : struct DESKTOP_DEPLOYMENTMISC_DLLPUBLIC StrTitle
      50                 :            : {
      51                 :       2838 :     static css::uno::Sequence< rtl::OUString > getTitleSequence()
      52                 :            :     {
      53                 :       2838 :         css::uno::Sequence< rtl::OUString > aSeq( 1 );
      54         [ +  - ]:       2838 :         aSeq[ 0 ] = "Title";
      55                 :       2838 :         return aSeq;
      56                 :            :     }
      57                 :       6856 :     static rtl::OUString getTitle( ::ucbhelper::Content &rContent )
      58                 :            :     {
      59                 :            :         return rtl::OUString( rContent.getPropertyValue(
      60 [ +  - ][ +  - ]:       6856 :                 rtl::OUString::createFromAscii( "Title" ) ).get<rtl::OUString>() );
      61                 :            :     }
      62                 :            :     // just return titles - the ucbhelper should have a simpler API for this [!]
      63                 :            :     static css::uno::Reference< css::sdbc::XResultSet >
      64                 :       1138 :         createCursor( ::ucbhelper::Content &rContent,
      65                 :            :                       ucbhelper::ResultSetInclude eInclude )
      66                 :            :     {
      67                 :            :         return css::uno::Reference< css::sdbc::XResultSet >(
      68         [ +  - ]:       1138 :                 rContent.createCursor( StrTitle::getTitleSequence(), eInclude ) );
      69                 :            :     }
      70                 :            : };
      71                 :            : 
      72                 :            : //==============================================================================
      73                 :            : DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool create_ucb_content(
      74                 :            :     ::ucbhelper::Content * ucb_content,
      75                 :            :     ::rtl::OUString const & url,
      76                 :            :     css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
      77                 :            :     bool throw_exc = true );
      78                 :            : 
      79                 :            : //==============================================================================
      80                 :            : /** @return true if previously non-existing folder has been created
      81                 :            :  */
      82                 :            : DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool create_folder(
      83                 :            :     ::ucbhelper::Content * ucb_content,
      84                 :            :     ::rtl::OUString const & url,
      85                 :            :     css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
      86                 :            :     bool throw_exc = true );
      87                 :            : 
      88                 :            : //==============================================================================
      89                 :            : DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool erase_path(
      90                 :            :     ::rtl::OUString const & url,
      91                 :            :     css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
      92                 :            :     bool throw_exc = true );
      93                 :            : 
      94                 :            : //==============================================================================
      95                 :            : DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
      96                 :            : ::rtl::ByteSequence readFile( ::ucbhelper::Content & ucb_content );
      97                 :            : 
      98                 :            : //==============================================================================
      99                 :            : DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
     100                 :            : bool readLine( ::rtl::OUString * res, ::rtl::OUString const & startingWith,
     101                 :            :                ::ucbhelper::Content & ucb_content, rtl_TextEncoding textenc );
     102                 :            : 
     103                 :            : DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
     104                 :            : bool readProperties( ::std::list< ::std::pair< ::rtl::OUString, ::rtl::OUString> > & out_result,
     105                 :            :                 ::ucbhelper::Content & ucb_content);
     106                 :            : 
     107                 :            : 
     108                 :            : 
     109                 :            : }
     110                 :            : 
     111                 :            : #endif
     112                 :            : 
     113                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10