LCOV - code coverage report
Current view: top level - libreoffice/ucb/source/ucp/package - pkguri.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 25 0.0 %
Date: 2012-12-27 Functions: 0 14 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             : #ifndef _PKGURI_HXX
      21             : #define _PKGURI_HXX
      22             : 
      23             : #include <rtl/ustring.hxx>
      24             : 
      25             : namespace package_ucp {
      26             : 
      27             : //=========================================================================
      28             : 
      29             : #define PACKAGE_URL_SCHEME          "vnd.sun.star.pkg"
      30             : #define PACKAGE_ZIP_URL_SCHEME      "vnd.sun.star.zip"
      31             : #define PACKAGE_URL_SCHEME_LENGTH   16
      32             : 
      33             : //=========================================================================
      34             : 
      35           0 : class PackageUri
      36             : {
      37             :     mutable ::rtl::OUString m_aUri;
      38             :     mutable ::rtl::OUString m_aParentUri;
      39             :     mutable ::rtl::OUString m_aPackage;
      40             :     mutable ::rtl::OUString m_aPath;
      41             :     mutable ::rtl::OUString m_aName;
      42             :     mutable ::rtl::OUString m_aParam;
      43             :     mutable ::rtl::OUString m_aScheme;
      44             :     mutable bool            m_bValid;
      45             : 
      46             : private:
      47             :     void init() const;
      48             : 
      49             : public:
      50             :     PackageUri() : m_bValid( false ) {}
      51           0 :     PackageUri( const ::rtl::OUString & rPackageUri )
      52           0 :     : m_aUri( rPackageUri ), m_bValid( false ) {}
      53             : 
      54           0 :     sal_Bool isValid() const
      55           0 :     { init(); return m_bValid; }
      56             : 
      57           0 :     const ::rtl::OUString & getUri() const
      58           0 :     { init(); return m_aUri; }
      59             : 
      60           0 :     void setUri( const ::rtl::OUString & rPackageUri )
      61           0 :     { m_aPath = ::rtl::OUString(); m_aUri = rPackageUri; m_bValid = false; }
      62             : 
      63           0 :     const ::rtl::OUString & getParentUri() const
      64           0 :     { init(); return m_aParentUri; }
      65             : 
      66           0 :     const ::rtl::OUString & getPackage() const
      67           0 :     { init(); return m_aPackage; }
      68             : 
      69           0 :     const ::rtl::OUString & getPath() const
      70           0 :     { init(); return m_aPath; }
      71             : 
      72           0 :     const ::rtl::OUString & getName() const
      73           0 :     { init(); return m_aName; }
      74             : 
      75           0 :     const ::rtl::OUString & getParam() const
      76           0 :     { init(); return m_aParam; }
      77             : 
      78           0 :     const ::rtl::OUString & getScheme() const
      79           0 :     { init(); return m_aScheme; }
      80             : 
      81             :     inline sal_Bool isRootFolder() const;
      82             : };
      83             : 
      84           0 : inline sal_Bool PackageUri::isRootFolder() const
      85             : {
      86           0 :     init();
      87           0 :     return ( ( m_aPath.getLength() == 1 ) &&
      88           0 :              ( m_aPath.getStr()[ 0 ] == sal_Unicode( '/' ) ) );
      89             : }
      90             : 
      91             : }
      92             : 
      93             : #endif
      94             : 
      95             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10