LibreOffice Module desktop (master)  1
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
dp_misc Namespace Reference

Namespaces

 Dependencies
 Dependency handling.
 

Classes

class  AbortChannel
 
class  DescriptionInfoset
 Access to the content of an XML description element. More...
 
class  MutexHolder
 
class  PersistentMap
 
class  ProgressLevel
 
struct  SimpleLicenseAttributes
 
struct  StrTitle
 
struct  UpdateInfo
 

Typedefs

typedef std::unordered_map< OString, OString > t_string2string_map
 
typedef std::map< OUString, UpdateInfoUpdateInfoMap
 

Enumerations

enum  UPDATE_SOURCE {
  UPDATE_SOURCE_NONE,
  UPDATE_SOURCE_SHARED,
  UPDATE_SOURCE_BUNDLED,
  UPDATE_SOURCE_ONLINE
}
 
enum  Order {
  LESS,
  EQUAL,
  GREATER
}
 

Functions

static OString encodeString (const OString &rStr)
 
static OString decodeString (const sal_Char *pEncChars, int nLen)
 
void xml_parse (Reference< xml::sax::XDocumentHandler > const &xDocHandler,::ucbhelper::Content &ucb_content, Reference< XComponentContext > const &xContext)
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC DescriptionInfoset getDescriptionInfoset (OUString const &sExtensionFolderURL)
 creates a DescriptionInfoset object. More...
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC OUString generateIdentifier (::boost::optional< OUString > const &optional, OUString const &fileName)
 Generates an identifier from an optional identifier. More...
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC OUString getIdentifier (css::uno::Reference< css::deployment::XPackage > const &package)
 Gets the identifier of a package. More...
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC OUString generateLegacyIdentifier (OUString const &fileName)
 Generates a legacy identifier based on a file name. More...
 
void progressUpdate (OUString const &status, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv)
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool interactContinuation (css::uno::Any const &request, css::uno::Type const &continuation, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv, bool *pcont, bool *pabort)
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC OUString const & getPlatformString ()
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool platform_fits (OUString const &platform_string)
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool hasValidPlatform (css::uno::Sequence< OUString > const &platformStrings)
 determines if the current platform corresponds to one of the platform strings. More...
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC const LanguageTaggetOfficeLanguageTag ()
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool create_ucb_content (::ucbhelper::Content *ucb_content, OUString const &url, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv, bool throw_exc=true)
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool create_folder (::ucbhelper::Content *ucb_content, OUString const &url, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv, bool throw_exc=true)
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool erase_path (OUString const &url, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv, bool throw_exc=true)
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC std::vector< sal_Int8readFile (::ucbhelper::Content &ucb_content)
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool readLine (OUString *res, OUString const &startingWith,::ucbhelper::Content &ucb_content, rtl_TextEncoding textenc)
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool readProperties (std::vector< std::pair< OUString, OUString > > &out_result,::ucbhelper::Content &ucb_content)
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC OUString getExtensionDefaultUpdateURL ()
 returns the default update URL (for the update information) which is used when an extension does not provide its own URL. More...
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC UPDATE_SOURCE isUpdateUserExtension (bool bReadOnlyShared, OUString const &userVersion, OUString const &sharedVersion, OUString const &bundledVersion, OUString const &onlineVersion)
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC UPDATE_SOURCE isUpdateSharedExtension (bool bReadOnlyShared, OUString const &sharedVersion, OUString const &bundledVersion, OUString const &onlineVersion)
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC css::uno::Reference< css::deployment::XPackage > getExtensionWithHighestVersion (css::uno::Sequence< css::uno::Reference< css::deployment::XPackage > > const &seqExtensionsWithSameId)
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC UpdateInfoMap getOnlineUpdateInfos (css::uno::Reference< css::uno::XComponentContext > const &xContext, css::uno::Reference< css::deployment::XExtensionManager > const &xExtMgr, css::uno::Reference< css::deployment::XUpdateInformationProvider > const &updateInformation, std::vector< css::uno::Reference< css::deployment::XPackage > > const *extensionList, std::vector< std::pair< css::uno::Reference< css::deployment::XPackage >, css::uno::Any > > &out_errors)
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC OUString getHighestVersion (OUString const &sharedVersion, OUString const &bundledVersion, OUString const &onlineVersion)
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC Order compareVersions (OUString const &version1, OUString const &version2)
 
void xml_parse (css::uno::Reference< css::xml::sax::XDocumentHandler > const &xDocHandler,::ucbhelper::Content &ucb_content, css::uno::Reference< css::uno::XComponentContext > const &xContext)
 
bool interactContinuation (Any const &request, Type const &continuation, Reference< XCommandEnvironment > const &xCmdEnv, bool *pcont, bool *pabort)
 
OUString makeURL (OUString const &baseURL, OUString const &relPath)
 appends a relative path to a url. More...
 
OUString makeURLAppendSysPathSegment (OUString const &baseURL, OUString const &relPath)
 appends a relative path to a url. More...
 
OUString expandUnoRcTerm (OUString const &term_)
 
OUString makeRcTerm (OUString const &url)
 
OUString expandUnoRcUrl (OUString const &url)
 
bool office_is_running ()
 
oslProcess raiseProcess (OUString const &appURL, Sequence< OUString > const &args)
 
OUString generateRandomPipeId ()
 
Reference< XInterfaceresolveUnoURL (OUString const &connectString, Reference< XComponentContext > const &xLocalContext, AbortChannel const *abortChannel)
 
static void writeConsoleWithStream (OUString const &sText, FILE *stream)
 
void writeConsole (OUString const &sText)
 writes the argument string to the console. More...
 
void writeConsoleError (OUString const &sText)
 writes the argument to the console using the error stream. More...
 
OUString readConsole ()
 reads from the console. More...
 
void TRACE (OUString const &sText)
 print the text to the console in a debug build. More...
 
void syncRepositories (bool force, Reference< ucb::XCommandEnvironment > const &xCmdEnv)
 
void disposeBridges (Reference< css::uno::XComponentContext > const &ctx)
 
bool create_ucb_content (::ucbhelper::Content *ret_ucbContent, OUString const &url, Reference< XCommandEnvironment > const &xCmdEnv, bool throw_exc)
 
bool create_folder (::ucbhelper::Content *ret_ucb_content, OUString const &url_, Reference< XCommandEnvironment > const &xCmdEnv, bool throw_exc)
 
bool erase_path (OUString const &url, Reference< XCommandEnvironment > const &xCmdEnv, bool throw_exc)
 
Reference< deployment::XPackage > getExtensionWithHighestVersion (Sequence< Reference< deployment::XPackage > > const &seqExt)
 
UpdateInfoMap getOnlineUpdateInfos (Reference< uno::XComponentContext > const &xContext, Reference< deployment::XExtensionManager > const &xExtMgr, Reference< deployment::XUpdateInformationProvider > const &updateInformation, std::vector< Reference< deployment::XPackage > > const *extensionList, std::vector< std::pair< Reference< deployment::XPackage >, uno::Any > > &out_errors)
 
void try_dispose (css::uno::Reference< css::uno::XInterface > const &x)
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC css::uno::Reference< css::uno::XInterface > resolveUnoURL (OUString const &connectString, css::uno::Reference< css::uno::XComponentContext > const &xLocalContext, AbortChannel const *abortChannel=nullptr)
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC oslProcess raiseProcess (OUString const &appURL, css::uno::Sequence< OUString > const &args)
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC void syncRepositories (bool force, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv)
 registers or revokes shared or bundled extensions which have been recently added or removed. More...
 
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC void disposeBridges (css::uno::Reference< css::uno::XComponentContext > const &ctx)
 workaround: for some reason the bridge threads which communicate with the uno.exe process are not released on time More...
 

Variables

static const char PmapMagic [4] = {'P','m','p','1'}
 
const sal_Char CR = 0x0d
 
const sal_Char LF = 0x0a
 

Typedef Documentation

typedef std::unordered_map< OString, OString > dp_misc::t_string2string_map

Definition at line 31 of file dp_persmap.h.

Definition at line 102 of file dp_update.hxx.

Enumeration Type Documentation

Enumerator
LESS 
EQUAL 
GREATER 

Definition at line 29 of file dp_version.hxx.

Enumerator
UPDATE_SOURCE_NONE 
UPDATE_SOURCE_SHARED 
UPDATE_SOURCE_BUNDLED 
UPDATE_SOURCE_ONLINE 

Definition at line 44 of file dp_update.hxx.

Function Documentation

dp_misc::Order dp_misc::compareVersions ( OUString const &  version1,
OUString const &  version2 
)
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool dp_misc::create_folder ( ::ucbhelper::Content ucb_content,
OUString const &  url,
css::uno::Reference< css::ucb::XCommandEnvironment > const &  xCmdEnv,
bool  throw_exc = true 
)
bool dp_misc::create_folder ( ::ucbhelper::Content ret_ucb_content,
OUString const &  url_,
Reference< XCommandEnvironment > const &  xCmdEnv,
bool  throw_exc 
)
bool dp_misc::create_ucb_content ( ::ucbhelper::Content ret_ucbContent,
OUString const &  url,
Reference< XCommandEnvironment > const &  xCmdEnv,
bool  throw_exc 
)
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool dp_misc::create_ucb_content ( ::ucbhelper::Content ucb_content,
OUString const &  url,
css::uno::Reference< css::ucb::XCommandEnvironment > const &  xCmdEnv,
bool  throw_exc = true 
)
static OString dp_misc::decodeString ( const sal_Char pEncChars,
int  nLen 
)
static

Definition at line 104 of file dp_persmap.cxx.

References i, and pChar.

Referenced by dp_misc::PersistentMap::readAll().

DESKTOP_DEPLOYMENTMISC_DLLPUBLIC void dp_misc::disposeBridges ( css::uno::Reference< css::uno::XComponentContext > const &  ctx)

workaround: for some reason the bridge threads which communicate with the uno.exe process are not released on time

void dp_misc::disposeBridges ( Reference< css::uno::XComponentContext > const &  ctx)

Definition at line 569 of file dp_misc.cxx.

References comp, dp_registry::backend::bundle::create(), and i.

Referenced by dp_gui::MyApp::DeInit(), and unopkg_main().

static OString dp_misc::encodeString ( const OString &  rStr)
static

Definition at line 67 of file dp_persmap.cxx.

References i, and pChar.

Referenced by dp_misc::PersistentMap::flush().

DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool dp_misc::erase_path ( OUString const &  url,
css::uno::Reference< css::ucb::XCommandEnvironment > const &  xCmdEnv,
bool  throw_exc = true 
)
bool dp_misc::erase_path ( OUString const &  url,
Reference< XCommandEnvironment > const &  xCmdEnv,
bool  throw_exc 
)

Definition at line 166 of file dp_ucb.cxx.

References Any, create_ucb_content(), Exception, and ucbhelper::Content::executeCommand().

DESKTOP_DEPLOYMENTMISC_DLLPUBLIC OUString dp_misc::expandUnoRcTerm ( OUString const &  term_)

Definition at line 307 of file dp_misc.cxx.

DESKTOP_DEPLOYMENTMISC_DLLPUBLIC OUString dp_misc::expandUnoRcUrl ( OUString const &  url)
OUString dp_misc::generateIdentifier ( ::boost::optional< OUString > const &  optional,
OUString const &  fileName 
)

Generates an identifier from an optional identifier.

Parameters
optionalan optional identifier
fileNamea file name
Returns
the given optional identifier if present, otherwise a legacy identifier based on the given file name

Definition at line 36 of file dp_identifier.cxx.

References generateLegacyIdentifier().

OUString dp_misc::generateLegacyIdentifier ( OUString const &  fileName)

Generates a legacy identifier based on a file name.

Parameters
fileNamea file name
Returns
a legacy identifier based on the given file name

Definition at line 52 of file dp_identifier.cxx.

Referenced by generateIdentifier(), dp_manager::ActivePackages::getEntries(), and getIdentifier().

DESKTOP_DEPLOYMENTMISC_DLLPUBLIC OUString dp_misc::generateRandomPipeId ( )

Definition at line 422 of file dp_misc.cxx.

References SAL_N_ELEMENTS.

DescriptionInfoset dp_misc::getDescriptionInfoset ( OUString const &  sExtensionFolderURL)
OUString dp_misc::getExtensionDefaultUpdateURL ( )

returns the default update URL (for the update information) which is used when an extension does not provide its own URL.

Definition at line 222 of file dp_update.cxx.

References SAL_CONFIGFILE.

DESKTOP_DEPLOYMENTMISC_DLLPUBLIC css::uno::Reference< css::deployment::XPackage> dp_misc::getExtensionWithHighestVersion ( css::uno::Sequence< css::uno::Reference< css::deployment::XPackage > > const &  seqExtensionsWithSameId)
Reference<deployment::XPackage> dp_misc::getExtensionWithHighestVersion ( Sequence< Reference< deployment::XPackage > > const &  seqExt)

Definition at line 307 of file dp_update.cxx.

References compareVersions(), GREATER, and i.

OUString dp_misc::getHighestVersion ( OUString const &  sharedVersion,
OUString const &  bundledVersion,
OUString const &  onlineVersion 
)
OUString dp_misc::getIdentifier ( css::uno::Reference< css::deployment::XPackage > const &  package)
const LanguageTag & dp_misc::getOfficeLanguageTag ( )

Definition at line 51 of file dp_resource.cxx.

Referenced by dp_misc::DescriptionInfoset::getLocalizedChild().

DESKTOP_DEPLOYMENTMISC_DLLPUBLIC UpdateInfoMap dp_misc::getOnlineUpdateInfos ( css::uno::Reference< css::uno::XComponentContext > const &  xContext,
css::uno::Reference< css::deployment::XExtensionManager > const &  xExtMgr,
css::uno::Reference< css::deployment::XUpdateInformationProvider > const &  updateInformation,
std::vector< css::uno::Reference< css::deployment::XPackage > > const *  extensionList,
std::vector< std::pair< css::uno::Reference< css::deployment::XPackage >, css::uno::Any > > &  out_errors 
)
UpdateInfoMap dp_misc::getOnlineUpdateInfos ( Reference< uno::XComponentContext > const &  xContext,
Reference< deployment::XExtensionManager > const &  xExtMgr,
Reference< deployment::XUpdateInformationProvider > const &  updateInformation,
std::vector< Reference< deployment::XPackage > > const *  extensionList,
std::vector< std::pair< Reference< deployment::XPackage >, uno::Any > > &  out_errors 
)

Definition at line 340 of file dp_update.cxx.

References getExtensionWithHighestVersion(), and getIdentifier().

OUString const & dp_misc::getPlatformString ( )

Definition at line 165 of file dp_platform.cxx.

bool dp_misc::hasValidPlatform ( css::uno::Sequence< OUString > const &  platformStrings)

determines if the current platform corresponds to one of the platform strings.

Definition at line 190 of file dp_platform.cxx.

References i.

bool dp_misc::interactContinuation ( Any const &  request,
Type const &  continuation,
Reference< XCommandEnvironment > const &  xCmdEnv,
bool *  pcont,
bool *  pabort 
)

Definition at line 95 of file dp_interact.cxx.

References isAssignableFrom().

DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool dp_misc::interactContinuation ( css::uno::Any const &  request,
css::uno::Type const &  continuation,
css::uno::Reference< css::ucb::XCommandEnvironment > const &  xCmdEnv,
bool *  pcont,
bool *  pabort 
)
Returns
true if ia handler is present and any selection has been chosen

Referenced by dp_manager::ExtensionManager::checkInstall(), and dp_manager::ExtensionManager::checkUpdate().

UPDATE_SOURCE dp_misc::isUpdateSharedExtension ( bool  bReadOnlyShared,
OUString const &  sharedVersion,
OUString const &  bundledVersion,
OUString const &  onlineVersion 
)
UPDATE_SOURCE dp_misc::isUpdateUserExtension ( bool  bReadOnlyShared,
OUString const &  userVersion,
OUString const &  sharedVersion,
OUString const &  bundledVersion,
OUString const &  onlineVersion 
)
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC OUString dp_misc::makeRcTerm ( OUString const &  url)

Definition at line 314 of file dp_misc.cxx.

DESKTOP_DEPLOYMENTMISC_DLLPUBLIC OUString dp_misc::makeURL ( OUString const &  baseURL,
OUString const &  relPath 
)
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC OUString dp_misc::makeURLAppendSysPathSegment ( OUString const &  baseURL,
OUString const &  relPath 
)
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool dp_misc::office_is_running ( )
bool dp_misc::platform_fits ( OUString const &  platform_string)

Definition at line 170 of file dp_platform.cxx.

References index.

void dp_misc::progressUpdate ( OUString const &  status,
css::uno::Reference< css::ucb::XCommandEnvironment > const &  xCmdEnv 
)
inline

Definition at line 33 of file dp_interact.h.

Referenced by dp_manager::PackageManagerImpl::addPackage().

DESKTOP_DEPLOYMENTMISC_DLLPUBLIC oslProcess dp_misc::raiseProcess ( OUString const &  appURL,
css::uno::Sequence< OUString > const &  args 
)
oslProcess dp_misc::raiseProcess ( OUString const &  appURL,
Sequence< OUString > const &  args 
)

Definition at line 386 of file dp_misc.cxx.

DESKTOP_DEPLOYMENTMISC_DLLPUBLIC OUString dp_misc::readConsole ( )

reads from the console.

On Linux/Unix/etc. it uses fgets to read char values and converts them to OUString using osl_getThreadTextEncoding as target encoding. The returned string has a maximum size of 1024 and does NOT include leading and trailing white space(applied OUString::trim())

Definition at line 502 of file dp_misc.cxx.

References value.

std::vector< sal_Int8 > dp_misc::readFile ( ::ucbhelper::Content ucb_content)
bool dp_misc::readLine ( OUString *  res,
OUString const &  startingWith,
::ucbhelper::Content ucb_content,
rtl_TextEncoding  textenc 
)

Definition at line 203 of file dp_ucb.cxx.

References CR, LF, and readFile().

bool dp_misc::readProperties ( std::vector< std::pair< OUString, OUString > > &  out_result,
::ucbhelper::Content ucb_content 
)

Definition at line 259 of file dp_ucb.cxx.

References CR, LF, name, readFile(), and value.

DESKTOP_DEPLOYMENTMISC_DLLPUBLIC css::uno::Reference< css::uno::XInterface> dp_misc::resolveUnoURL ( OUString const &  connectString,
css::uno::Reference< css::uno::XComponentContext > const &  xLocalContext,
AbortChannel const *  abortChannel = nullptr 
)
Reference<XInterface> dp_misc::resolveUnoURL ( OUString const &  connectString,
Reference< XComponentContext > const &  xLocalContext,
AbortChannel const *  abortChannel 
)
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC void dp_misc::syncRepositories ( bool  force,
css::uno::Reference< css::ucb::XCommandEnvironment > const &  xCmdEnv 
)

registers or revokes shared or bundled extensions which have been recently added or removed.

void dp_misc::syncRepositories ( bool  force,
Reference< ucb::XCommandEnvironment > const &  xCmdEnv 
)
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC void dp_misc::TRACE ( OUString const &  sText)
void dp_misc::try_dispose ( css::uno::Reference< css::uno::XInterface > const &  x)
inline
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC void dp_misc::writeConsole ( OUString const &  sText)

writes the argument string to the console.

On Linux/Unix/etc. it converts the UTF16 string to an ANSI string using osl_getThreadTextEncoding() as target encoding. On Windows it uses WriteFile with the standard out stream. unopkg.com reads the data and prints them out using WriteConsoleW.

Definition at line 484 of file dp_misc.cxx.

References writeConsoleWithStream().

Referenced by unopkg::printf_packages(), unopkg::printf_unaccepted_licenses(), and unopkg_main().

DESKTOP_DEPLOYMENTMISC_DLLPUBLIC void dp_misc::writeConsoleError ( OUString const &  sText)

writes the argument to the console using the error stream.

Otherwise the same as writeConsole.

Definition at line 493 of file dp_misc.cxx.

References writeConsoleWithStream().

Referenced by unopkg_main().

static void dp_misc::writeConsoleWithStream ( OUString const &  sText,
FILE *  stream 
)
static

Definition at line 476 of file dp_misc.cxx.

References OUStringToOString().

Referenced by writeConsole(), and writeConsoleError().

void dp_misc::xml_parse ( Reference< xml::sax::XDocumentHandler > const &  xDocHandler,
::ucbhelper::Content ucb_content,
Reference< XComponentContext > const &  xContext 
)
void dp_misc::xml_parse ( css::uno::Reference< css::xml::sax::XDocumentHandler > const &  xDocHandler,
::ucbhelper::Content ucb_content,
css::uno::Reference< css::uno::XComponentContext > const &  xContext 
)

Variable Documentation

const sal_Char dp_misc::CR = 0x0d

Definition at line 37 of file dp_misc.h.

Referenced by readLine(), and readProperties().

const sal_Char dp_misc::LF = 0x0a

Definition at line 38 of file dp_misc.h.

Referenced by readLine(), and readProperties().

const char dp_misc::PmapMagic[4] = {'P','m','p','1'}
static

Definition at line 38 of file dp_persmap.cxx.

Referenced by dp_misc::PersistentMap::readAll().