|
NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
This class handles the documentation index and provides lookup functionalities to obtain the corresponding article. More...
#include <doc_helper.hpp>
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... | |
| FileSystem & | assign (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< DocumentationEntry > | vDocIndexTable |
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 |
This class handles the documentation index and provides lookup functionalities to obtain the corresponding article.
Definition at line 38 of file doc_helper.hpp.
| Documentation::Documentation | ( | ) |
| Documentation::~Documentation | ( | ) |
The destructor closes the internal file stream, if it is still open.
Definition at line 235 of file doc_helper.cpp.
|
private |
Add a new entry to the documentation index respecting already existing versions of the new entry. Older versions will be overwritten.
| entry | const DocumentationEntry& |
| keyWords | const std::vector<std::string>& |
Definition at line 251 of file doc_helper.cpp.
References findPositionUsingIdxKeys(), getAllArguments(), mDocumentationIndex, DocumentationEntry::sIdxKeys, and vDocIndexTable.
Referenced by 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.
| sFileName | const std::string& |
Definition at line 498 of file doc_helper.cpp.
References addEntry(), and DocumentationFile::getArticles().
Referenced by createDocumentationIndex(), and Script::writeDocumentationArticle().
| void Documentation::createDocumentationIndex | ( | bool | bLoadUserLangFiles = true | ) |
This member function loads the index files to memory.
| bLoadUserLangFiles | bool |
Definition at line 456 of file doc_helper.cpp.
References addFileToDocumentationIndex(), getFileList(), NumeReKernel::getInstance(), NumeReKernel::getSettings(), and FileSystem::ValidFolderName().
Referenced by NumeReKernel::StartUp().
|
private |
This private member function returns the position of the queried topic in the documentation index table.
| sTopic | const std::string& |
Definition at line 291 of file doc_helper.cpp.
References mDocumentationIndex.
Referenced by getHelpArticle(), getHelpArticleID(), getHelpArticleTitle(), and getHelpIdxKey().
|
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.
| sIdxKeys | const std::string& |
Definition at line 346 of file doc_helper.cpp.
References getAllArguments(), and mDocumentationIndex.
Referenced by addEntry().
|
static |
This static member is a fallback for the XML-parsing logic-stuff.
| sCmd | const std::string& |
| nPos | unsigned int |
Definition at line 382 of file doc_helper.cpp.
References getMatchingParenthesis(), and StripSpaces().
Referenced by doc_HelpAsHTML(), doc_ReplaceTokensForHTML(), findArticleById(), and Script::writeWholeFile().
| 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.
Definition at line 646 of file doc_helper.cpp.
References getAllArguments(), mDocumentationIndex, and vDocIndexTable.
Referenced by NumeReKernel::getDocIndex().
| 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.
| sTopic | const 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().
| std::string Documentation::getHelpArticleID | ( | const std::string & | sTopic | ) |
This member function returns the article ID corresponding to the queried topic.
| sTopic | const std::string& |
Definition at line 712 of file doc_helper.cpp.
References findPositionInDocumentationIndex(), and vDocIndexTable.
Referenced by doc_Help().
| std::string Documentation::getHelpArticleTitle | ( | const std::string & | _sIdxKey | ) |
This member function returns the documentation article title corresponding to the queried index key.
| _sIdxKey | const std::string& |
Definition at line 732 of file doc_helper.cpp.
References findPositionInDocumentationIndex(), and vDocIndexTable.
Referenced by doc_Help().
| std::string Documentation::getHelpIdxKey | ( | const std::string & | sTopic | ) |
This member function returns an index key, which corresponds to the queried topic.
| sTopic | const std::string& |
Definition at line 687 of file doc_helper.cpp.
References findPositionInDocumentationIndex(), and vDocIndexTable.
Referenced by doc_Help().
| void Documentation::removeFromDocIndex | ( | const std::string & | _sID | ) |
This member function removes the index entry passed to the function from the documentation index.
| _sID | const string& |
Definition at line 531 of file doc_helper.cpp.
References SyntaxError::INVALID_HLPIDX, SyntaxError::invalid_position, mDocumentationIndex, and vDocIndexTable.
Referenced by NumeReKernel::uninstallPlugin().
|
private |
Definition at line 41 of file doc_helper.hpp.
Referenced by addEntry(), findPositionInDocumentationIndex(), findPositionUsingIdxKeys(), getDocIndex(), and removeFromDocIndex().
|
private |
Definition at line 42 of file doc_helper.hpp.
Referenced by addEntry(), Documentation(), getDocIndex(), getHelpArticle(), getHelpArticleID(), getHelpArticleTitle(), getHelpIdxKey(), and removeFromDocIndex().