NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
Documentation Class Reference

This class handles the documentation index and provides lookup functionalities to obtain the corresponding article. More...

#include <doc_helper.hpp>

Inheritance diagram for Documentation:
Collaboration diagram for Documentation:

Public Member Functions

 Documentation ()
 The default constructor. More...
 
 ~Documentation ()
 The destructor closes the internal file stream, if it is still open. More...
 
void createDocumentationIndex (bool bLoadUserLangFiles=true)
 This member function loads the index files to memory. More...
 
void addFileToDocumentationIndex (const std::string &sFileName)
 This member function is used to add documentation index entries to the index during a plugin or package installation. More...
 
void removeFromDocIndex (const std::string &_sID)
 This member function removes the index entry passed to the function from the documentation index. More...
 
std::vector< std::string > getHelpArticle (const std::string &sTopic)
 This member function returns the documentation article, which corresponds to the passed documentation topic of the the whole documentation index in readable form. More...
 
std::vector< std::string > getDocIndex () const
 This member function returns the key list for the documentation index prepared for the corresponding tree in the documentation browser. More...
 
std::string getHelpIdxKey (const std::string &sTopic)
 This member function returns an index key, which corresponds to the queried topic. More...
 
std::string getHelpArticleID (const std::string &sTopic)
 This member function returns the article ID corresponding to the queried topic. More...
 
std::string getHelpArticleTitle (const std::string &_sIdxKey)
 This member function returns the documentation article title corresponding to the queried index key. More...
 
- Public Member Functions inherited from FileSystem
 FileSystem ()
 Default constructor. More...
 
FileSystemassign (const FileSystem &_fSys)
 Assignment member function to copy the settings from another FileSystem instance. More...
 
std::string ValidFileName (std::string _sFileName, const std::string sExtension=".dat", bool checkExtension=true, bool doCleanPath=true) const
 This member function evaluates, whether the passed filename is a valid filename. One may supply a preferred filename extension. More...
 
std::string ValidFolderName (std::string _sFileName, bool doCleanPath=true, bool appendTrailingSeparator=true) const
 This member function evaluates, whether the passed foldername is a valid foldername. More...
 
std::string ValidizeAndPrepareName (const std::string &_sFileName, const std::string &sExtension=".dat") const
 This member function validizes the passed file name and creates the needed folders on-the-fly. More...
 
int setPath (std::string _sPath, bool bMkDir, std::string _sExePath)
 This member function may be used to set the preferred file path of the current FileSystem instance. More...
 
void createRevisionsFolder ()
 This member function creates the hidden revisions folders for the version control system. More...
 
std::string getPath () const
 Returns the default path of this FileSystem instance. More...
 
std::vector< std::string > getFileParts (const std::string &sFilePath) const
 This member function separates all path parts into single strings: the drive letter, the path, the name and the extension. This function may also handle folder paths and network paths. More...
 
FileInfo getFileInfo (const std::string &sFilePath) const
 Return the file information about the passed file path. More...
 
void setTokens (std::string _sTokens)
 This member function may be used to update the path placeholders of the current FileSystem instance. More...
 
bool isFile (const std::string &_sPath) const
 This function determines, whether a path name indicates a file or a folder. More...
 
void initializeFromKernel ()
 Member function to remote-initialize the class from the kernel. Cannot be used during kernel start-up. More...
 
void setProgramPath (std::string _sExePath)
 
std::string getProgramPath () const
 
void declareFileType (const std::string &sFileType)
 

Static Public Member Functions

static std::string getArgAtPos (const std::string &sCmd, unsigned int pos)
 This static member is a fallback for the XML-parsing logic-stuff. More...
 

Private Member Functions

void addEntry (const DocumentationEntry &entry, const std::vector< std::string > &keyWords)
 Add a new entry to the documentation index respecting already existing versions of the new entry. Older versions will be overwritten. More...
 
int findPositionInDocumentationIndex (const std::string &sTopic) const
 This private member function returns the position of the queried topic in the documentation index table. More...
 
int findPositionUsingIdxKeys (const std::string &sIdxKeys) const
 Finds the best match of a documentation entry using a list of index keys. If multiple matches have been found, the entry with the most matches will be returned. If nothing is found, the function will return -1. More...
 

Private Attributes

std::map< std::string, int > mDocumentationIndex
 
std::vector< DocumentationEntryvDocIndexTable
 

Additional Inherited Members

- Protected Member Functions inherited from FileSystem
int createFolders (const std::string &_sPath) const
 This member function creates all missing directories in the passed path. More...
 
- Protected Attributes inherited from FileSystem
std::string sPath
 
std::string sExecutablePath
 
std::string sTokens [7][2]
 
std::string sValidExtensions
 

Detailed Description

This class handles the documentation index and provides lookup functionalities to obtain the corresponding article.

Definition at line 38 of file doc_helper.hpp.

Constructor & Destructor Documentation

◆ Documentation()

Documentation::Documentation ( )

The default constructor.

Definition at line 225 of file doc_helper.cpp.

References vDocIndexTable.

◆ ~Documentation()

Documentation::~Documentation ( )

The destructor closes the internal file stream, if it is still open.

Definition at line 235 of file doc_helper.cpp.

Member Function Documentation

◆ addEntry()

void Documentation::addEntry ( const DocumentationEntry entry,
const std::vector< std::string > &  keyWords 
)
private

Add a new entry to the documentation index respecting already existing versions of the new entry. Older versions will be overwritten.

Parameters
entryconst DocumentationEntry&
keyWordsconst std::vector<std::string>&
Returns
void

Definition at line 251 of file doc_helper.cpp.

References findPositionUsingIdxKeys(), getAllArguments(), mDocumentationIndex, DocumentationEntry::sIdxKeys, and vDocIndexTable.

Referenced by addFileToDocumentationIndex().

Here is the call graph for this function:

◆ addFileToDocumentationIndex()

void Documentation::addFileToDocumentationIndex ( const std::string &  sFileName)

This member function is used to add documentation index entries to the index during a plugin or package installation.

Parameters
sFileNameconst std::string&
Returns
void

Definition at line 498 of file doc_helper.cpp.

References addEntry(), and DocumentationFile::getArticles().

Referenced by createDocumentationIndex(), and Script::writeDocumentationArticle().

Here is the call graph for this function:

◆ createDocumentationIndex()

void Documentation::createDocumentationIndex ( bool  bLoadUserLangFiles = true)

This member function loads the index files to memory.

Parameters
bLoadUserLangFilesbool
Returns
void

Definition at line 456 of file doc_helper.cpp.

References addFileToDocumentationIndex(), getFileList(), NumeReKernel::getInstance(), NumeReKernel::getSettings(), and FileSystem::ValidFolderName().

Referenced by NumeReKernel::StartUp().

Here is the call graph for this function:

◆ findPositionInDocumentationIndex()

int Documentation::findPositionInDocumentationIndex ( const std::string &  sTopic) const
private

This private member function returns the position of the queried topic in the documentation index table.

Parameters
sTopicconst std::string&
Returns
int

Definition at line 291 of file doc_helper.cpp.

References mDocumentationIndex.

Referenced by getHelpArticle(), getHelpArticleID(), getHelpArticleTitle(), and getHelpIdxKey().

◆ findPositionUsingIdxKeys()

int Documentation::findPositionUsingIdxKeys ( const std::string &  sIdxKeys) const
private

Finds the best match of a documentation entry using a list of index keys. If multiple matches have been found, the entry with the most matches will be returned. If nothing is found, the function will return -1.

Parameters
sIdxKeysconst std::string&
Returns
int

Definition at line 346 of file doc_helper.cpp.

References getAllArguments(), and mDocumentationIndex.

Referenced by addEntry().

Here is the call graph for this function:

◆ getArgAtPos()

std::string Documentation::getArgAtPos ( const std::string &  sCmd,
unsigned int  nPos 
)
static

This static member is a fallback for the XML-parsing logic-stuff.

Parameters
sCmdconst std::string&
nPosunsigned int
Returns
std::string

Definition at line 382 of file doc_helper.cpp.

References getMatchingParenthesis(), and StripSpaces().

Referenced by doc_HelpAsHTML(), doc_ReplaceTokensForHTML(), findArticleById(), and Script::writeWholeFile().

Here is the call graph for this function:

◆ getDocIndex()

std::vector< std::string > Documentation::getDocIndex ( ) const

This member function returns the key list for the documentation index prepared for the corresponding tree in the documentation browser.

Returns
std::vector<std::string>

Definition at line 646 of file doc_helper.cpp.

References getAllArguments(), mDocumentationIndex, and vDocIndexTable.

Referenced by NumeReKernel::getDocIndex().

Here is the call graph for this function:

◆ getHelpArticle()

std::vector< std::string > Documentation::getHelpArticle ( const std::string &  sTopic)

This member function returns the documentation article, which corresponds to the passed documentation topic of the the whole documentation index in readable form.

Parameters
sTopicconst std::string&
Returns
std::vector<std::string>

Definition at line 581 of file doc_helper.cpp.

References _lang, findPositionInDocumentationIndex(), Language::get(), getAllArguments(), SyntaxError::INVALID_HLPIDX, SyntaxError::invalid_position, loadDocumentationArticle(), toString(), FileSystem::ValidFileName(), and vDocIndexTable.

Referenced by doc_Help(), and doc_HelpAsHTML().

Here is the call graph for this function:

◆ getHelpArticleID()

std::string Documentation::getHelpArticleID ( const std::string &  sTopic)

This member function returns the article ID corresponding to the queried topic.

Parameters
sTopicconst std::string&
Returns
std::string

Definition at line 712 of file doc_helper.cpp.

References findPositionInDocumentationIndex(), and vDocIndexTable.

Referenced by doc_Help().

Here is the call graph for this function:

◆ getHelpArticleTitle()

std::string Documentation::getHelpArticleTitle ( const std::string &  _sIdxKey)

This member function returns the documentation article title corresponding to the queried index key.

Parameters
_sIdxKeyconst std::string&
Returns
std::string

Definition at line 732 of file doc_helper.cpp.

References findPositionInDocumentationIndex(), and vDocIndexTable.

Referenced by doc_Help().

Here is the call graph for this function:

◆ getHelpIdxKey()

std::string Documentation::getHelpIdxKey ( const std::string &  sTopic)

This member function returns an index key, which corresponds to the queried topic.

Parameters
sTopicconst std::string&
Returns
std::string

Definition at line 687 of file doc_helper.cpp.

References findPositionInDocumentationIndex(), and vDocIndexTable.

Referenced by doc_Help().

Here is the call graph for this function:

◆ removeFromDocIndex()

void Documentation::removeFromDocIndex ( const std::string &  _sID)

This member function removes the index entry passed to the function from the documentation index.

Parameters
_sIDconst string&
Returns
void

Definition at line 531 of file doc_helper.cpp.

References SyntaxError::INVALID_HLPIDX, SyntaxError::invalid_position, mDocumentationIndex, and vDocIndexTable.

Referenced by NumeReKernel::uninstallPlugin().

Member Data Documentation

◆ mDocumentationIndex

std::map<std::string,int> Documentation::mDocumentationIndex
private

◆ vDocIndexTable

std::vector<DocumentationEntry> Documentation::vDocIndexTable
private

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