LibreOffice Module helpcompiler (master) 1
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
HelpIndexer Class Reference

#include <HelpIndexer.hxx>

Public Member Functions

 HelpIndexer (OUString lang, OUString module, std::u16string_view srcDir, std::u16string_view outDir)
 
bool indexDocuments ()
 Run the indexer. More...
 
OUString const & getErrorMessage () const
 Get the error string (empty if no error occurred). More...
 

Private Member Functions

bool scanForFiles ()
 Scan the caption & contents directories for help files. More...
 
bool scanForFiles (OUString const &path)
 Scan for files in the given directory. More...
 
void helpDocument (OUString const &fileName, lucene::document::Document *doc) const
 Fill the Document with information on the given help file. More...
 

Static Private Member Functions

static lucene::util::Reader * helpFileReader (OUString const &path)
 Create a reader for the given file, and create an "empty" reader in case the file doesn't exist. More...
 

Private Attributes

OUString d_lang
 
OUString d_module
 
OUString d_captionDir
 
OUString d_contentDir
 
OUString d_indexDir
 
OUString d_error
 
std::set< OUString > d_files
 

Detailed Description

Definition at line 33 of file HelpIndexer.hxx.

Constructor & Destructor Documentation

◆ HelpIndexer()

HelpIndexer::HelpIndexer ( OUString  lang,
OUString  module,
std::u16string_view  srcDir,
std::u16string_view  outDir 
)
Parameters
langHelp files language.
moduleThe module of the helpfiles.
srcDirThe help directory to index
outDirThe directory to write the "module".idxl directory to

Definition at line 33 of file HelpIndexer.cxx.

References d_captionDir, d_contentDir, d_indexDir, d_module, and module.

Member Function Documentation

◆ getErrorMessage()

OUString const & HelpIndexer::getErrorMessage ( ) const
inline

Get the error string (empty if no error occurred).

Definition at line 63 of file HelpIndexer.hxx.

Referenced by main().

◆ helpDocument()

void HelpIndexer::helpDocument ( OUString const &  fileName,
lucene::document::Document *  doc 
) const
private

Fill the Document with information on the given help file.

Definition at line 163 of file HelpIndexer.cxx.

References d_captionDir, d_contentDir, d_module, URLEncoder::encode(), Field, helpFileReader(), and OUStringToTCHARVec().

Referenced by indexDocuments().

◆ helpFileReader()

lucene::util::Reader * HelpIndexer::helpFileReader ( OUString const &  path)
staticprivate

Create a reader for the given file, and create an "empty" reader in case the file doesn't exist.

Definition at line 183 of file HelpIndexer.cxx.

References OUStringToOString().

Referenced by helpDocument().

◆ indexDocuments()

bool HelpIndexer::indexDocuments ( )

Run the indexer.

Returns
true if index successfully generated.

Definition at line 74 of file HelpIndexer.cxx.

References d_error, d_files, d_indexDir, d_lang, Document, o3tl::getToken(), helpDocument(), OUStringToOString(), o3tl::runtimeToOUString(), scanForFiles(), and u.

Referenced by main().

◆ scanForFiles() [1/2]

bool HelpIndexer::scanForFiles ( )
private

Scan the caption & contents directories for help files.

Definition at line 133 of file HelpIndexer.cxx.

References d_captionDir, d_contentDir, and scanForFiles().

Referenced by indexDocuments(), and scanForFiles().

◆ scanForFiles() [2/2]

bool HelpIndexer::scanForFiles ( OUString const &  path)
private

Scan for files in the given directory.

Definition at line 143 of file HelpIndexer.cxx.

References d_error, and d_files.

Member Data Documentation

◆ d_captionDir

OUString HelpIndexer::d_captionDir
private

Definition at line 37 of file HelpIndexer.hxx.

Referenced by helpDocument(), HelpIndexer(), and scanForFiles().

◆ d_contentDir

OUString HelpIndexer::d_contentDir
private

Definition at line 38 of file HelpIndexer.hxx.

Referenced by helpDocument(), HelpIndexer(), and scanForFiles().

◆ d_error

OUString HelpIndexer::d_error
private

Definition at line 40 of file HelpIndexer.hxx.

Referenced by indexDocuments(), and scanForFiles().

◆ d_files

std::set<OUString> HelpIndexer::d_files
private

Definition at line 41 of file HelpIndexer.hxx.

Referenced by indexDocuments(), and scanForFiles().

◆ d_indexDir

OUString HelpIndexer::d_indexDir
private

Definition at line 39 of file HelpIndexer.hxx.

Referenced by HelpIndexer(), and indexDocuments().

◆ d_lang

OUString HelpIndexer::d_lang
private

Definition at line 35 of file HelpIndexer.hxx.

Referenced by indexDocuments().

◆ d_module

OUString HelpIndexer::d_module
private

Definition at line 36 of file HelpIndexer.hxx.

Referenced by helpDocument(), and HelpIndexer().


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