1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <com/sun/star/uno/Exception.hpp>
21 #include <com/sun/star/uno/XComponentContext.hpp>
22 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
23 #include <com/sun/star/deployment/XPackage.hpp>
24 #include <osl/diagnose.h>
25 #include <rtl/ustring.hxx>
29 #define APP_NAME "unopkg"
36 sal_uInt32 m_name_length
;
37 sal_Unicode m_short_option
;
41 struct LockFileException
: public css::uno::Exception
43 explicit LockFileException(OUString
const & sMessage
) :
44 css::uno::Exception(sMessage
, css::uno::Reference
< css::uno::XInterface
> ()) {}
48 OUString
toString( OptionInfo
const * info
);
51 OptionInfo
const * getOptionInfo(
52 OptionInfo
const * list
,
53 OUString
const & opt
);
56 bool isOption( OptionInfo
const * option_info
, sal_uInt32
* pIndex
);
60 OUString
* pValue
, OptionInfo
const * option_info
,
61 sal_uInt32
* pIndex
);
64 inline bool readOption(
65 bool * flag
, OptionInfo
const * option_info
, sal_uInt32
* pIndex
)
67 if (isOption( option_info
, pIndex
)) {
68 OSL_ASSERT( flag
!= nullptr );
76 /** checks if an argument is a bootstrap variable. These start with -env:. For example
77 -env:UNO_JAVA_JFW_USER_DATA=file:///d:/user
79 bool isBootstrapVariable(sal_uInt32
* pIndex
);
81 OUString
const & getExecutableDir();
84 OUString
const & getProcessWorkingDir();
87 OUString
makeAbsoluteFileUrl(
88 OUString
const & sys_path
, OUString
const & base_url
);
93 css::uno::Reference
<css::ucb::XCommandEnvironment
> createCmdEnv(
94 css::uno::Reference
<css::uno::XComponentContext
> const & xContext
,
95 bool option_force_overwrite
,
97 bool option_suppressLicense
);
101 css::uno::Reference
<css::deployment::XPackage
> > const & allExtensions
,
102 std::vector
<bool> const & vecUnaccepted
,
103 css::uno::Reference
<css::ucb::XCommandEnvironment
> const & xCmdEnv
,
104 sal_Int32 level
= 0 );
109 css::uno::Reference
<css::uno::XComponentContext
> getUNO(
110 bool verbose
, bool bGui
, const OUString
& sTempDir
,
111 css::uno::Reference
<css::uno::XComponentContext
> & out_LocalComponentContext
);
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */