LibreOffice Module unotools (master) 1
bootstrap.hxx
Go to the documentation of this file.
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 INCLUDED_UNOTOOLS_BOOTSTRAP_HXX
21#define INCLUDED_UNOTOOLS_BOOTSTRAP_HXX
22
24#include <rtl/ustring.hxx>
25
26namespace utl
27{
36 {
37 // the static interface
38 public: // some common information items
39
41 static OUString getProductKey();
42
44 static OUString getProductKey(OUString const& _sDefault);
45
47 static OUString getBuildIdData(OUString const& _sDefault);
48
50 static void reloadData();
51
52 public: // retrieve path information about the installation location
54 {
55 PATH_EXISTS, // Success: Found a path to an existing file or directory
56 PATH_VALID, // Found a valid path, but the file or directory does not exist
57 DATA_INVALID, // Retrieved a string for this path, that is not a valid file url or system path
58 DATA_MISSING, // Could not retrieve any data for this path
59 DATA_UNKNOWN // No attempt to retrieve data for this path was made
60 };
61
63 static PathStatus locateBaseInstallation(OUString& _rURL);
64
66 static PathStatus locateUserInstallation(OUString& _rURL);
67
69 static PathStatus locateUserData(OUString& _rURL);
70
71 // the next two items are mainly supported for diagnostic purposes. both items may be unused
73 static PathStatus locateBootstrapFile(OUString& _rURL);
75 static PathStatus locateVersionFile(OUString& _rURL);
76
77 public: // evaluate the validity of the installation
79 enum Status
80 {
84 INVALID_BASE_INSTALL
85 };
86
89 {
99 INVALID_BOOTSTRAP_DATA
100 };
101
105 static Status checkBootstrapStatus(OUString& _rDiagnosticMessage, FailureCode& _rErrCode);
106
107 public:
109 static bool getProcessWorkingDir(OUString &rUrl);
110
111 public:
112 // singleton impl-class
114 static const Impl& data(); // the data related to the bootstrap.ini file
115 };
116}
117
118#endif
119
120/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
provides configuration information needed for application startup.
Definition: bootstrap.hxx:36
FailureCode
error code for detailed diagnostics of bootstrap failures
Definition: bootstrap.hxx:89
@ MISSING_BOOTSTRAP_FILE
the shared installation directory could not be located
Definition: bootstrap.hxx:92
@ MISSING_VERSION_FILE_ENTRY
the version locator INI file could not be found or read
Definition: bootstrap.hxx:96
@ INVALID_BOOTSTRAP_FILE_ENTRY
the bootstrap INI is missing a required entry
Definition: bootstrap.hxx:94
@ MISSING_USER_DIRECTORY
the version locator INI entry is not a valid directory URL
Definition: bootstrap.hxx:98
@ INVALID_VERSION_FILE_ENTRY
the version locator INI has no entry for this version
Definition: bootstrap.hxx:97
@ MISSING_BOOTSTRAP_FILE_ENTRY
the bootstrap INI file could not be found or read
Definition: bootstrap.hxx:93
@ MISSING_VERSION_FILE
the bootstrap INI contains invalid data
Definition: bootstrap.hxx:95
@ MISSING_INSTALL_DIRECTORY
bootstrap was successful
Definition: bootstrap.hxx:91
Status
high-level status of bootstrap success
Definition: bootstrap.hxx:80
@ INVALID_USER_INSTALL
${userurl} does not exist; or version-file cannot be found or is invalid
Definition: bootstrap.hxx:83
@ MISSING_USER_INSTALL
user-dir and share-dir do exist, product key found or can be defaulted to exe-name
Definition: bootstrap.hxx:82
Status
OUString const & getProcessWorkingDir()
#define UNOTOOLS_DLLPRIVATE
#define UNOTOOLS_DLLPUBLIC