LibreOffice Module xmlhelp (master) 1
|
#include <databases.hxx>
Public Member Functions | |
Databases (bool showBasic, const OUString &instPath, const OUString &productName, const OUString &productVersion, const OUString &styleSheet, css::uno::Reference< css::uno::XComponentContext > const &xContext) | |
Input is the installdirectory in system dependent notation. More... | |
~Databases () | |
OString | getImageTheme () const |
OUString | getInstallPathAsURL () |
OUString | getInstallPathAsURL (std::unique_lock< std::mutex > &rGuard) |
const std::vector< OUString > & | getModuleList (const OUString &Language) |
StaticModuleInformation * | getStaticInformationForModule (std::u16string_view Module, const OUString &Language) |
bool | checkModuleMatchForExtension (std::u16string_view Database, const OUString &doclist) |
KeywordInfo * | getKeyword (const OUString &Module, const OUString &Language) |
helpdatafileproxy::Hdf * | getHelpDataFile (std::u16string_view Module, const OUString &Language, bool helpText=false, const OUString *pExtensionPath=nullptr) |
helpdatafileproxy::Hdf * | getHelpDataFile (std::unique_lock< std::mutex > &rGuard, std::u16string_view Module, const OUString &Language, bool helpText=false, const OUString *pExtensionPath=nullptr) |
css::uno::Reference< css::i18n::XCollator > | getCollator (std::unique_lock< std::mutex > &rGuard, const OUString &Language) |
The following method returns the Collator for the given language-country combination. More... | |
void | cascadingStylesheet (const OUString &Language, OStringBuffer &buffer) |
Returns the cascading style sheet used to format the HTML-output. More... | |
void | changeCSS (const OUString &newStyleSheet) |
Changes the stylesheet for further reads. More... | |
void | setActiveText (const OUString &Module, const OUString &Language, std::u16string_view Id, OStringBuffer &buffer) |
Returns the active help text for the given module, language and id. More... | |
css::uno::Reference< css::container::XHierarchicalNameAccess > | jarFile (std::unique_lock< std::mutex > &rGuard, std::u16string_view jar, const OUString &Language) |
Has the purpose of forcing the jarfile to stay open. More... | |
css::uno::Reference< css::container::XHierarchicalNameAccess > | findJarFileForPath (const OUString &jar, const OUString &Language, const OUString &path, OUString *o_pExtensionPath=nullptr, OUString *o_pExtensionRegistryPath=nullptr) |
OUString | processLang (const OUString &Language) |
Maps a given language-locale combination to language or locale. More... | |
OUString | processLang (std::unique_lock< std::mutex > &rGuard, const OUString &Language) |
void | replaceName (OUString &oustring) const |
const OUString & | getProductName () const |
const OUString & | getProductVersion () const |
OUString | expandURL (const OUString &aURL) |
OUString | expandURL (std::unique_lock< std::mutex > &rGuard, const OUString &aURL) |
Static Public Member Functions | |
static OUString | expandURL (const OUString &aURL, const css::uno::Reference< css::uno::XComponentContext > &xContext) |
Private Types | |
enum | { PRODUCTNAME = 0 , PRODUCTVERSION , VENDORNAME , VENDORVERSION , VENDORSHORT , NEWPRODUCTNAME , NEWPRODUCTVERSION } |
typedef std::unordered_map< OUString, std::unique_ptr< helpdatafileproxy::Hdf > > | DatabasesTable |
typedef std::unordered_map< OUString, OUString > | LangSetTable |
typedef std::unordered_map< OUString, std::unique_ptr< StaticModuleInformation > > | ModInfoTable |
typedef std::unordered_map< OUString, std::unique_ptr< KeywordInfo > > | KeywordInfoTable |
typedef std::unordered_map< OUString, css::uno::Reference< css::container::XHierarchicalNameAccess > > | ZipFileTable |
typedef std::unordered_map< OUString, css::uno::Reference< css::i18n::XCollator > > | CollatorTable |
typedef std::unordered_set< OString > | EmptyActiveTextSet |
Private Member Functions | |
void | setInstallPath (const OUString &aInstallDirectory) |
Private Attributes | |
std::mutex | m_aMutex |
css::uno::Reference< css::uno::XComponentContext > | m_xContext |
css::uno::Reference< css::lang::XMultiComponentFactory > | m_xSMgr |
css::uno::Reference< css::ucb::XSimpleFileAccess3 > | m_xSFA |
bool | m_bShowBasic |
std::vector< char > | m_vCustomCSSDoc |
OUString | m_aCSS |
int | m_vAdd [7] |
OUString | m_vReplacement [7] |
OUString | m_aInstallDirectory |
std::vector< OUString > | m_avModules |
DatabasesTable | m_aDatabases |
LangSetTable | m_aLangSet |
ModInfoTable | m_aModInfo |
KeywordInfoTable | m_aKeywordInfo |
ZipFileTable | m_aZipFileTable |
CollatorTable | m_aCollatorTable |
EmptyActiveTextSet | m_aEmptyActiveTextSet |
Definition at line 129 of file databases.hxx.
|
private |
Definition at line 278 of file databases.hxx.
|
private |
Definition at line 257 of file databases.hxx.
|
private |
Definition at line 284 of file databases.hxx.
|
private |
Definition at line 266 of file databases.hxx.
|
private |
Definition at line 260 of file databases.hxx.
|
private |
Definition at line 263 of file databases.hxx.
|
private |
Definition at line 272 of file databases.hxx.
|
private |
Enumerator | |
---|---|
PRODUCTNAME | |
PRODUCTVERSION | |
VENDORNAME | |
VENDORVERSION | |
VENDORSHORT | |
NEWPRODUCTNAME | |
NEWPRODUCTVERSION |
Definition at line 240 of file databases.hxx.
Databases::Databases | ( | bool | showBasic, |
const OUString & | instPath, | ||
const OUString & | productName, | ||
const OUString & | productVersion, | ||
const OUString & | styleSheet, | ||
css::uno::Reference< css::uno::XComponentContext > const & | xContext | ||
) |
Input is the installdirectory in system dependent notation.
Definition at line 134 of file databases.cxx.
References m_vAdd, m_vReplacement, m_xContext, m_xContext, m_xSFA, m_xSMgr, and setInstallPath().
Databases::~Databases | ( | ) |
Definition at line 165 of file databases.cxx.
References m_aDatabases, m_aKeywordInfo, and m_aModInfo.
void Databases::cascadingStylesheet | ( | const OUString & | Language, |
OStringBuffer & | buffer | ||
) |
Returns the cascading style sheet used to format the HTML-output.
First try is language directory, second try is main installation directory.
Definition at line 949 of file databases.cxx.
References a, getInstallPathAsURL(), LONG, m_aCSS, m_vCustomCSSDoc, and processLang().
void Databases::changeCSS | ( | const OUString & | newStyleSheet | ) |
Changes the stylesheet for further reads.
Definition at line 943 of file databases.cxx.
References m_aCSS, and m_vCustomCSSDoc.
bool Databases::checkModuleMatchForExtension | ( | std::u16string_view | Database, |
const OUString & | doclist | ||
) |
Definition at line 674 of file databases.cxx.
References Database, m_avModules, and result.
Referenced by getKeyword().
OUString Databases::expandURL | ( | const OUString & | aURL | ) |
Definition at line 82 of file databases.cxx.
References aURL, expandURL(), and m_aMutex.
Referenced by expandURL(), getHelpDataFile(), and jarFile().
|
static |
OUString Databases::expandURL | ( | std::unique_lock< std::mutex > & | rGuard, |
const OUString & | aURL | ||
) |
Definition at line 88 of file databases.cxx.
References aURL, expandURL(), and m_xContext.
Reference< XHierarchicalNameAccess > Databases::findJarFileForPath | ( | const OUString & | jar, |
const OUString & | Language, | ||
const OUString & | path, | ||
OUString * | o_pExtensionPath = nullptr , |
||
OUString * | o_pExtensionRegistryPath = nullptr |
||
) |
Definition at line 881 of file databases.cxx.
References m_aMutex, m_xContext, and chelp::JarFileIterator::nextJarFile().
Referenced by chelp::URLParameter::isErrorDocument().
Reference< XCollator > Databases::getCollator | ( | std::unique_lock< std::mutex > & | rGuard, |
const OUString & | Language | ||
) |
The following method returns the Collator for the given language-country combination.
Definition at line 497 of file databases.cxx.
References LanguageTag::getCountry(), LanguageTag::getLanguage(), LanguageTag::getLocale(), m_aCollatorTable, m_xContext, and LanguageTag::reset().
Referenced by getKeyword().
helpdatafileproxy::Hdf * Databases::getHelpDataFile | ( | std::u16string_view | Module, |
const OUString & | Language, | ||
bool | helpText = false , |
||
const OUString * | pExtensionPath = nullptr |
||
) |
Definition at line 438 of file databases.cxx.
References Database, getHelpDataFile(), and m_aMutex.
Referenced by getHelpDataFile(), getKeyword(), chelp::DataBaseIterator::implGetHdfFromPackage(), and chelp::DataBaseIterator::nextHdf().
helpdatafileproxy::Hdf * Databases::getHelpDataFile | ( | std::unique_lock< std::mutex > & | rGuard, |
std::u16string_view | Module, | ||
const OUString & | Language, | ||
bool | helpText = false , |
||
const OUString * | pExtensionPath = nullptr |
||
) |
Definition at line 447 of file databases.cxx.
References aFileExt, Database, expandURL(), m_aDatabases, m_aInstallDirectory, m_xSFA, and processLang().
OString Databases::getImageTheme | ( | ) | const |
Definition at line 179 of file databases.cxx.
References comphelper::InitAnyPropertySequence(), and m_xContext.
OUString Databases::getInstallPathAsURL | ( | ) |
Definition at line 273 of file databases.cxx.
References m_aInstallDirectory, and m_aMutex.
Referenced by cascadingStylesheet(), getModuleList(), chelp::KeyDataBaseFileIterator::nextDbFile(), and chelp::IndexFolderIterator::nextIndexFolder().
OUString Databases::getInstallPathAsURL | ( | std::unique_lock< std::mutex > & | rGuard | ) |
Definition at line 280 of file databases.cxx.
References m_aInstallDirectory.
KeywordInfo * Databases::getKeyword | ( | const OUString & | Module, |
const OUString & | Language | ||
) |
Definition at line 722 of file databases.cxx.
References checkModuleMatchForExtension(), helpdatafileproxy::Hdf::createHashMap(), Database, getCollator(), helpdatafileproxy::HDFData::getData(), getHelpDataFile(), helpdatafileproxy::Hdf::getNextKeyAndValue(), helpdatafileproxy::HDFData::getSize(), m_aKeywordInfo, m_aMutex, m_xContext, m_xSFA, chelp::KeyDataBaseFileIterator::nextDbFile(), processLang(), helpdatafileproxy::Hdf::releaseHashMap(), helpdatafileproxy::Hdf::startIteration(), and helpdatafileproxy::Hdf::stopIteration().
const std::vector< OUString > & Databases::getModuleList | ( | const OUString & | Language | ) |
Definition at line 285 of file databases.cxx.
References getInstallPathAsURL(), m_avModules, m_bShowBasic, and processLang().
Referenced by chelp::ResultSetForRoot::ResultSetForRoot().
|
inline |
Definition at line 219 of file databases.hxx.
References m_vReplacement.
|
inline |
Definition at line 220 of file databases.hxx.
References m_vReplacement.
StaticModuleInformation * Databases::getStaticInformationForModule | ( | std::u16string_view | Module, |
const OUString & | Language | ||
) |
Definition at line 323 of file databases.cxx.
References ch, i, m_aInstallDirectory, m_aModInfo, m_aMutex, pos, processLang(), and replaceName().
Referenced by chelp::URLParameter::get_id(), chelp::URLParameter::get_program(), and chelp::URLParameter::get_title().
Reference< XHierarchicalNameAccess > Databases::jarFile | ( | std::unique_lock< std::mutex > & | rGuard, |
std::u16string_view | jar, | ||
const OUString & | Language | ||
) |
Has the purpose of forcing the jarfile to stay open.
Definition at line 801 of file databases.cxx.
References aArguments, Exception, expandURL(), m_aInstallDirectory, m_aZipFileTable, m_xContext, m_xSMgr, p, processLang(), and ZIP_STORAGE_FORMAT_STRING.
Referenced by chelp::JarFileIterator::nextJarFile().
OUString Databases::processLang | ( | const OUString & | Language | ) |
Maps a given language-locale combination to language or locale.
Definition at line 400 of file databases.cxx.
References m_aMutex, and processLang().
Referenced by cascadingStylesheet(), getHelpDataFile(), getKeyword(), getModuleList(), getStaticInformationForModule(), jarFile(), chelp::KeyDataBaseFileIterator::nextDbFile(), chelp::IndexFolderIterator::nextIndexFolder(), and processLang().
OUString Databases::processLang | ( | std::unique_lock< std::mutex > & | rGuard, |
const OUString & | Language | ||
) |
Definition at line 406 of file databases.cxx.
References m_aInstallDirectory, and m_aLangSet.
void Databases::replaceName | ( | OUString & | oustring | ) | const |
Definition at line 207 of file databases.cxx.
References idx, m_vAdd, m_vReplacement, newProdName, NEWPRODUCTNAME, NEWPRODUCTVERSION, newProdVersion, prodName, PRODUCTNAME, PRODUCTVERSION, prodVersion, vendName, VENDORNAME, VENDORSHORT, VENDORVERSION, vendShort, and vendVersion.
Referenced by getStaticInformationForModule(), chelp::KeywordInfo::KeywordElement::init(), chelp::KeywordInfo::KeywordElement::KeywordElement(), chelp::URLParameter::readHelpDataFile(), and setActiveText().
void Databases::setActiveText | ( | const OUString & | Module, |
const OUString & | Language, | ||
std::u16string_view | Id, | ||
OStringBuffer & | buffer | ||
) |
Returns the active help text for the given module, language and id.
Definition at line 1055 of file databases.cxx.
References helpdatafileproxy::HDFData::getData(), helpdatafileproxy::HDFData::getSize(), helpdatafileproxy::Hdf::getValueForKey(), i, m_aEmptyActiveTextSet, m_xContext, chelp::DataBaseIterator::nextHdf(), OUStringToOString(), pData, and replaceName().
|
private |
Definition at line 1112 of file databases.cxx.
References m_aInstallDirectory, and m_aMutex.
Referenced by Databases().
|
private |
Definition at line 279 of file databases.hxx.
Referenced by getCollator().
|
private |
Definition at line 238 of file databases.hxx.
Referenced by cascadingStylesheet(), and changeCSS().
|
private |
Definition at line 258 of file databases.hxx.
Referenced by getHelpDataFile(), and ~Databases().
|
private |
Definition at line 285 of file databases.hxx.
Referenced by setActiveText().
|
private |
Definition at line 253 of file databases.hxx.
Referenced by getHelpDataFile(), getInstallPathAsURL(), getStaticInformationForModule(), jarFile(), processLang(), and setInstallPath().
|
private |
Definition at line 267 of file databases.hxx.
Referenced by getKeyword(), and ~Databases().
|
private |
Definition at line 261 of file databases.hxx.
Referenced by processLang().
|
private |
Definition at line 264 of file databases.hxx.
Referenced by getStaticInformationForModule(), and ~Databases().
|
private |
Definition at line 230 of file databases.hxx.
Referenced by expandURL(), findJarFileForPath(), getHelpDataFile(), getInstallPathAsURL(), getKeyword(), getStaticInformationForModule(), processLang(), and setInstallPath().
|
private |
Definition at line 255 of file databases.hxx.
Referenced by checkModuleMatchForExtension(), and getModuleList().
|
private |
Definition at line 273 of file databases.hxx.
Referenced by jarFile().
|
private |
Definition at line 235 of file databases.hxx.
Referenced by getModuleList().
|
private |
Definition at line 250 of file databases.hxx.
Referenced by Databases(), and replaceName().
|
private |
Definition at line 237 of file databases.hxx.
Referenced by cascadingStylesheet(), and changeCSS().
|
private |
Definition at line 251 of file databases.hxx.
Referenced by Databases(), getProductName(), getProductVersion(), and replaceName().
|
private |
Definition at line 231 of file databases.hxx.
Referenced by Databases(), expandURL(), findJarFileForPath(), getCollator(), getImageTheme(), getKeyword(), jarFile(), and setActiveText().
|
private |
Definition at line 233 of file databases.hxx.
Referenced by Databases(), getHelpDataFile(), and getKeyword().
|
private |
Definition at line 232 of file databases.hxx.
Referenced by Databases(), and jarFile().