NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
doc_helper.hpp
Go to the documentation of this file.
1/*****************************************************************************
2 NumeRe: Framework fuer Numerische Rechnungen
3 Copyright (C) 2014 Erik Haenel et al.
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17******************************************************************************/
18
19// CLASS: DOC_HELPER
20
21#ifndef DOC_HELPER_HPP
22#define DOC_HELPER_HPP
23
24#include <string>
25#include <vector>
26#include <map>
27
28#include "../io/filesystem.hpp"
29#include "../ui/error.hpp"
30
32
39{
40 private:
41 std::map<std::string,int> mDocumentationIndex;
42 std::vector<DocumentationEntry> vDocIndexTable;
43
44 void addEntry(const DocumentationEntry& entry, const std::vector<std::string>& keyWords);
45 int findPositionInDocumentationIndex(const std::string& sTopic) const;
46 int findPositionUsingIdxKeys(const std::string& sIdxKeys) const;
47
48 public:
51
52 void createDocumentationIndex(bool bLoadUserLangFiles = true);
53 void addFileToDocumentationIndex(const std::string& sFileName);
54 void removeFromDocIndex(const std::string& _sID);
55 std::vector<std::string> getHelpArticle(const std::string& sTopic);
56 std::vector<std::string> getDocIndex() const;
57 std::string getHelpIdxKey(const std::string& sTopic);
58 std::string getHelpArticleID(const std::string& sTopic);
59 std::string getHelpArticleTitle(const std::string& _sIdxKey);
60 static std::string getArgAtPos(const std::string& sCmd, unsigned int pos);
61};
62
63#endif
This class handles the documentation index and provides lookup functionalities to obtain the correspo...
Definition: doc_helper.hpp:39
~Documentation()
The destructor closes the internal file stream, if it is still open.
Definition: doc_helper.cpp:235
void addFileToDocumentationIndex(const std::string &sFileName)
This member function is used to add documentation index entries to the index during a plugin or packa...
Definition: doc_helper.cpp:498
std::string getHelpArticleID(const std::string &sTopic)
This member function returns the article ID corresponding to the queried topic.
Definition: doc_helper.cpp:712
std::vector< DocumentationEntry > vDocIndexTable
Definition: doc_helper.hpp:42
std::string getHelpIdxKey(const std::string &sTopic)
This member function returns an index key, which corresponds to the queried topic.
Definition: doc_helper.cpp:687
void removeFromDocIndex(const std::string &_sID)
This member function removes the index entry passed to the function from the documentation index.
Definition: doc_helper.cpp:531
std::vector< std::string > getHelpArticle(const std::string &sTopic)
This member function returns the documentation article, which corresponds to the passed documentation...
Definition: doc_helper.cpp:581
void createDocumentationIndex(bool bLoadUserLangFiles=true)
This member function loads the index files to memory.
Definition: doc_helper.cpp:456
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....
Definition: doc_helper.cpp:251
std::vector< std::string > getDocIndex() const
This member function returns the key list for the documentation index prepared for the corresponding ...
Definition: doc_helper.cpp:646
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 be...
Definition: doc_helper.cpp:346
std::string getHelpArticleTitle(const std::string &_sIdxKey)
This member function returns the documentation article title corresponding to the queried index key.
Definition: doc_helper.cpp:732
Documentation()
The default constructor.
Definition: doc_helper.cpp:225
static std::string getArgAtPos(const std::string &sCmd, unsigned int pos)
This static member is a fallback for the XML-parsing logic-stuff.
Definition: doc_helper.cpp:382
std::map< std::string, int > mDocumentationIndex
Definition: doc_helper.hpp:41
int findPositionInDocumentationIndex(const std::string &sTopic) const
This private member function returns the position of the queried topic in the documentation index tab...
Definition: doc_helper.cpp:291
This class implements the basic input/ output file system and provides functionalities to work with f...
Definition: filesystem.hpp:92
This structure defines a single entry in the documentation index.
Definition: docfile.hpp:30