1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dp_identifier.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_INC_DP_IDENTIFIER_HXX
32 #define INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_INC_DP_IDENTIFIER_HXX
34 #include "sal/config.h"
36 #include "boost/optional.hpp"
37 #include "com/sun/star/uno/Reference.hxx"
39 #include "dp_misc_api.hxx"
41 namespace com
{ namespace sun
{ namespace star
{ namespace deployment
{
44 namespace rtl
{ class OUString
; }
49 Generates an identifier from an optional identifier.
52 an optional identifier
58 the given optional identifier if present, otherwise a legacy identifier based
59 on the given file name
61 DESKTOP_DEPLOYMENTMISC_DLLPUBLIC ::rtl::OUString
generateIdentifier(
62 ::boost::optional
< ::rtl::OUString
> const & optional
,
63 ::rtl::OUString
const & fileName
);
66 Gets the identifier of a package.
72 the explicit identifier of the given package if present, otherwise the
73 implicit legacy identifier of the given package
75 @throws com::sun::star::uno::RuntimeException
77 DESKTOP_DEPLOYMENTMISC_DLLPUBLIC ::rtl::OUString
getIdentifier(
78 ::com::sun::star::uno::Reference
< ::com::sun::star::deployment::XPackage
>
82 Generates a legacy identifier based on a file name.
88 a legacy identifier based on the given file name
90 DESKTOP_DEPLOYMENTMISC_DLLPUBLIC ::rtl::OUString
generateLegacyIdentifier(
91 ::rtl::OUString
const & fileName
);