Bump for 3.6-28
[LibreOffice.git] / ucb / source / ucp / package / pkguri.hxx
blob733726eab4685ae82e48e171ad7f959ee33b1066
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
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.
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).
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.
27 ************************************************************************/
29 #ifndef _PKGURI_HXX
30 #define _PKGURI_HXX
32 #include <rtl/ustring.hxx>
34 namespace package_ucp {
36 //=========================================================================
38 #define PACKAGE_URL_SCHEME "vnd.sun.star.pkg"
39 #define PACKAGE_ZIP_URL_SCHEME "vnd.sun.star.zip"
40 #define PACKAGE_URL_SCHEME_LENGTH 16
42 //=========================================================================
44 class PackageUri
46 mutable ::rtl::OUString m_aUri;
47 mutable ::rtl::OUString m_aParentUri;
48 mutable ::rtl::OUString m_aPackage;
49 mutable ::rtl::OUString m_aPath;
50 mutable ::rtl::OUString m_aName;
51 mutable ::rtl::OUString m_aParam;
52 mutable ::rtl::OUString m_aScheme;
53 mutable bool m_bValid;
55 private:
56 void init() const;
58 public:
59 PackageUri() : m_bValid( false ) {}
60 PackageUri( const ::rtl::OUString & rPackageUri )
61 : m_aUri( rPackageUri ), m_bValid( false ) {}
63 sal_Bool isValid() const
64 { init(); return m_bValid; }
66 const ::rtl::OUString & getUri() const
67 { init(); return m_aUri; }
69 void setUri( const ::rtl::OUString & rPackageUri )
70 { m_aPath = ::rtl::OUString(); m_aUri = rPackageUri; m_bValid = false; }
72 const ::rtl::OUString & getParentUri() const
73 { init(); return m_aParentUri; }
75 const ::rtl::OUString & getPackage() const
76 { init(); return m_aPackage; }
78 const ::rtl::OUString & getPath() const
79 { init(); return m_aPath; }
81 const ::rtl::OUString & getName() const
82 { init(); return m_aName; }
84 const ::rtl::OUString & getParam() const
85 { init(); return m_aParam; }
87 const ::rtl::OUString & getScheme() const
88 { init(); return m_aScheme; }
90 inline sal_Bool isRootFolder() const;
93 inline sal_Bool PackageUri::isRootFolder() const
95 init();
96 return ( ( m_aPath.getLength() == 1 ) &&
97 ( m_aPath.getStr()[ 0 ] == sal_Unicode( '/' ) ) );
102 #endif
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */