NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
docfile.hpp
Go to the documentation of this file.
1/*****************************************************************************
2 NumeRe: Framework fuer Numerische Rechnungen
3 Copyright (C) 2021 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#ifndef DOCFILE_HPP
20#define DOCFILE_HPP
21
22#include <string>
23#include <vector>
24
30{
31 std::string sArticleId;
32 std::string sDocFilePath;
33 std::string sTitle;
34 std::string sIdxKeys;
35};
36
37
38
44{
46 std::vector<std::string> m_keywords;
47 std::vector<std::string> m_contents;
48
49 DocumentationArticle(const std::vector<std::string>& vArticleContents, const std::string& sFileName);
50 std::string format();
51};
52
53
54
61{
62 private:
63 std::vector<DocumentationArticle> m_articles;
64
65 std::vector<std::string> loadFromFile(const std::string& sFileName);
66 void parse(const std::vector<std::string>& vFileContents, const std::string& sFileName);
67
68 public:
69 DocumentationFile(const std::string& sFileName);
70 DocumentationFile(const std::vector<std::string>& vFileContents);
71
72 void print(const std::string& sFileName);
73
81 std::vector<DocumentationArticle>& getArticles()
82 {
83 return m_articles;
84 }
85
86};
87
88#endif // DOCFILE_HPP
89
90
91
This class represents a whole documentation file with its contained documentation articles.
Definition: docfile.hpp:61
void parse(const std::vector< std::string > &vFileContents, const std::string &sFileName)
Parse the documentation file into single articles. Only complete <article>..</article> sections are p...
Definition: docfile.cpp:304
void print(const std::string &sFileName)
Print the documentation file to the specified file.
Definition: docfile.cpp:336
std::vector< DocumentationArticle > m_articles
Definition: docfile.hpp:63
std::vector< std::string > loadFromFile(const std::string &sFileName)
Load the documentation file contents from the specified file.
Definition: docfile.cpp:275
std::vector< DocumentationArticle > & getArticles()
Get all articles present in the current documentation file.
Definition: docfile.hpp:81
DocumentationFile(const std::string &sFileName)
Create a DocumentationFile from the an actual file.
Definition: docfile.cpp:248
This structure defines a single article in a documentation file.
Definition: docfile.hpp:44
DocumentationEntry m_docEntry
Definition: docfile.hpp:45
std::vector< std::string > m_keywords
Definition: docfile.hpp:46
std::string format()
Format the documentation article into a single string, which then can be printed to a file.
Definition: docfile.cpp:199
DocumentationArticle(const std::vector< std::string > &vArticleContents, const std::string &sFileName)
Create a DocumentationArticle structure from the selected part of the documentation file containing e...
Definition: docfile.cpp:90
std::vector< std::string > m_contents
Definition: docfile.hpp:47
This structure defines a single entry in the documentation index.
Definition: docfile.hpp:30
std::string sDocFilePath
Definition: docfile.hpp:32
std::string sArticleId
Definition: docfile.hpp:31
std::string sIdxKeys
Definition: docfile.hpp:34
std::string sTitle
Definition: docfile.hpp:33