LibreOffice Module unotools (master) 1
Classes | Public Types | Static Public Member Functions | Public Attributes | List of all members
utl::Bootstrap Class Reference

provides configuration information needed for application startup. More...

#include <bootstrap.hxx>

Classes

class  Impl
 

Public Types

enum  PathStatus {
  PATH_EXISTS ,
  PATH_VALID ,
  DATA_INVALID ,
  DATA_MISSING ,
  DATA_UNKNOWN
}
 
enum  Status {
  DATA_OK ,
  MISSING_USER_INSTALL ,
  INVALID_USER_INSTALL ,
  INVALID_BASE_INSTALL
}
 high-level status of bootstrap success More...
 
enum  FailureCode {
  NO_FAILURE ,
  MISSING_INSTALL_DIRECTORY ,
  MISSING_BOOTSTRAP_FILE ,
  MISSING_BOOTSTRAP_FILE_ENTRY ,
  INVALID_BOOTSTRAP_FILE_ENTRY ,
  MISSING_VERSION_FILE ,
  MISSING_VERSION_FILE_ENTRY ,
  INVALID_VERSION_FILE_ENTRY ,
  MISSING_USER_DIRECTORY ,
  INVALID_BOOTSTRAP_DATA
}
 error code for detailed diagnostics of bootstrap failures More...
 

Static Public Member Functions

static OUString getProductKey ()
 retrieve the product key; defaults to executable name (without extension) More...
 
static OUString getProductKey (OUString const &_sDefault)
 retrieve the product key; uses the given default, if not found More...
 
static OUString getBuildIdData (OUString const &_sDefault)
 retrieve the BUILDID information item; uses the given default, if not found More...
 
static void reloadData ()
 reload cached data More...
 
static PathStatus locateBaseInstallation (OUString &_rURL)
 get a file URL to the common base installation [${insturl}] More...
 
static PathStatus locateUserInstallation (OUString &_rURL)
 get a file URL to the user installation [${userurl}] More...
 
static PathStatus locateUserData (OUString &_rURL)
 get a file URL to the user data directory [default is ${userurl}/user] More...
 
static PathStatus locateBootstrapFile (OUString &_rURL)
 get a file URL to the bootstrap INI file used [e.g. ${insturl}/program/bootraprc] More...
 
static PathStatus locateVersionFile (OUString &_rURL)
 get a file URL to the version locator INI file used [e.g. ${SYSUSERCONFIG}/sversion.ini] More...
 
static Status checkBootstrapStatus (OUString &_rDiagnosticMessage, FailureCode &_rErrCode)
 Evaluates the status of the installation and returns a diagnostic message and error code corresponding to this status. More...
 
static bool getProcessWorkingDir (OUString &rUrl)
 get the working directory of the process More...
 
static const Impldata ()
 

Public Attributes

class UNOTOOLS_DLLPRIVATE Impl
 

Detailed Description

provides configuration information needed for application startup.

This class handles the startup information for the office application. It encapsulates knowledge of how to retrieve such information and how to diagnose failures to retrieve required data.

Definition at line 35 of file bootstrap.hxx.

Member Enumeration Documentation

◆ FailureCode

error code for detailed diagnostics of bootstrap failures

Enumerator
NO_FAILURE 
MISSING_INSTALL_DIRECTORY 

bootstrap was successful

MISSING_BOOTSTRAP_FILE 

the shared installation directory could not be located

MISSING_BOOTSTRAP_FILE_ENTRY 

the bootstrap INI file could not be found or read

INVALID_BOOTSTRAP_FILE_ENTRY 

the bootstrap INI is missing a required entry

MISSING_VERSION_FILE 

the bootstrap INI contains invalid data

MISSING_VERSION_FILE_ENTRY 

the version locator INI file could not be found or read

INVALID_VERSION_FILE_ENTRY 

the version locator INI has no entry for this version

MISSING_USER_DIRECTORY 

the version locator INI entry is not a valid directory URL

INVALID_BOOTSTRAP_DATA 

the user installation directory does not exist

some bootstrap data was invalid in unexpected ways

Definition at line 88 of file bootstrap.hxx.

◆ PathStatus

Enumerator
PATH_EXISTS 
PATH_VALID 
DATA_INVALID 
DATA_MISSING 
DATA_UNKNOWN 

Definition at line 53 of file bootstrap.hxx.

◆ Status

high-level status of bootstrap success

Enumerator
DATA_OK 
MISSING_USER_INSTALL 

user-dir and share-dir do exist, product key found or can be defaulted to exe-name

INVALID_USER_INSTALL 

${userurl} does not exist; or version-file cannot be found or is invalid

INVALID_BASE_INSTALL 

can locate ${userurl}, but user-dir is missing

other failure: e.g. cannot locate share-dir; bootstraprc missing or invalid; no product key

Definition at line 79 of file bootstrap.hxx.

Member Function Documentation

◆ checkBootstrapStatus()

Bootstrap::Status utl::Bootstrap::checkBootstrapStatus ( OUString &  _rDiagnosticMessage,
FailureCode _rErrCode 
)
static

Evaluates the status of the installation and returns a diagnostic message and error code corresponding to this status.

Definition at line 612 of file bootstrap.cxx.

References aData, data(), DATA_OK, utl::describeError(), NO_FAILURE, and result.

◆ data()

const Bootstrap::Impl & utl::Bootstrap::data ( )
static

◆ getBuildIdData()

OUString utl::Bootstrap::getBuildIdData ( OUString const &  _sDefault)
static

retrieve the BUILDID information item; uses the given default, if not found

Definition at line 548 of file bootstrap.cxx.

References aData, BOOTSTRAP_ITEM_BUILDID, Translate::get(), and SAL_CONFIGFILE.

Referenced by utl::DocInfoHelper::GetGeneratorString().

◆ getProcessWorkingDir()

bool utl::Bootstrap::getProcessWorkingDir ( OUString &  rUrl)
static

get the working directory of the process

Definition at line 126 of file bootstrap.cxx.

Referenced by utl::implEnsureAbsolute().

◆ getProductKey() [1/2]

OUString utl::Bootstrap::getProductKey ( )
static

retrieve the product key; defaults to executable name (without extension)

Definition at line 536 of file bootstrap.cxx.

References BOOTSTRAP_ITEM_PRODUCT_KEY, data(), utl::Bootstrap::Impl::getBootstrapValue(), and utl::getExecutableBaseName().

◆ getProductKey() [2/2]

OUString utl::Bootstrap::getProductKey ( OUString const &  _sDefault)
static

retrieve the product key; uses the given default, if not found

Definition at line 543 of file bootstrap.cxx.

References BOOTSTRAP_ITEM_PRODUCT_KEY, data(), and utl::Bootstrap::Impl::getBootstrapValue().

◆ locateBaseInstallation()

Bootstrap::PathStatus utl::Bootstrap::locateBaseInstallation ( OUString &  _rURL)
static

get a file URL to the common base installation [${insturl}]

Definition at line 564 of file bootstrap.cxx.

References utl::Bootstrap::Impl::aBaseInstall_, data(), utl::Bootstrap::Impl::PathData::path, and utl::Bootstrap::Impl::PathData::status.

◆ locateBootstrapFile()

Bootstrap::PathStatus utl::Bootstrap::locateBootstrapFile ( OUString &  _rURL)
static

get a file URL to the bootstrap INI file used [e.g. ${insturl}/program/bootraprc]

Definition at line 596 of file bootstrap.cxx.

References utl::Bootstrap::Impl::aBootstrapINI_, data(), utl::Bootstrap::Impl::PathData::path, and utl::Bootstrap::Impl::PathData::status.

◆ locateUserData()

Bootstrap::PathStatus utl::Bootstrap::locateUserData ( OUString &  _rURL)
static

get a file URL to the user data directory [default is ${userurl}/user]

Definition at line 580 of file bootstrap.cxx.

References aData, BOOTSTRAP_DIRNAME_USERDIR, BOOTSTRAP_ITEM_USERDIR, utl::checkStatusAndNormalizeURL(), data(), and utl::getDerivedPath().

◆ locateUserInstallation()

Bootstrap::PathStatus utl::Bootstrap::locateUserInstallation ( OUString &  _rURL)
static

get a file URL to the user installation [${userurl}]

Definition at line 572 of file bootstrap.cxx.

References utl::Bootstrap::Impl::aUserInstall_, data(), utl::Bootstrap::Impl::PathData::path, and utl::Bootstrap::Impl::PathData::status.

◆ locateVersionFile()

Bootstrap::PathStatus utl::Bootstrap::locateVersionFile ( OUString &  _rURL)
static

get a file URL to the version locator INI file used [e.g. ${SYSUSERCONFIG}/sversion.ini]

Definition at line 604 of file bootstrap.cxx.

References utl::Bootstrap::Impl::aVersionINI_, data(), utl::Bootstrap::Impl::PathData::path, and utl::Bootstrap::Impl::PathData::status.

◆ reloadData()

void utl::Bootstrap::reloadData ( )
static

reload cached data

Definition at line 150 of file bootstrap.cxx.

Member Data Documentation

◆ Impl

Definition at line 113 of file bootstrap.hxx.


The documentation for this class was generated from the following files: