NumeRe
v1.1.4
NumeRe: Framework für Numerische Rechnungen
includer.hpp
Go to the documentation of this file.
1
/*****************************************************************************
2
NumeRe: Framework fuer Numerische Rechnungen
3
Copyright (C) 2022 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 INCLUDER_HPP
20
#define INCLUDER_HPP
21
22
#include <string>
23
#include "../io/filesystem.hpp"
24
#include "../io/styledtextfile.hpp"
25
31
class
Includer
:
public
FileSystem
32
{
33
public
:
34
enum
IncludeType
35
{
36
INCLUDE_ALL
= 0x0,
37
INCLUDE_DEFINES
= 0x1,
38
INCLUDE_DECLARATIONS
= 0x2,
39
INCLUDE_GLOBALS
= 0x4
40
};
41
42
private
:
43
StyledTextFile
*
m_include
;
44
int
nIncludeLine
;
45
int
m_type
;
46
47
void
openIncludedFile
(
const
std::string& sIncludingString);
48
49
public
:
50
Includer
(
const
std::string& sIncludingString,
const
std::string& sSearchPath);
51
~Includer
();
52
53
int
getCurrentLine
()
const
54
{
55
return
nIncludeLine
;
56
}
57
58
int
getIncludedType
()
const
59
{
60
return
m_type
;
61
}
62
63
std::string
getNextLine
();
64
bool
is_open
()
const
;
65
std::string
getIncludedFileName
()
const
;
66
static
bool
is_including_syntax
(
const
std::string& sLine);
67
};
68
69
#endif
// INCLUDER_HPP
70
71
FileSystem
This class implements the basic input/ output file system and provides functionalities to work with f...
Definition:
filesystem.hpp:92
Includer
This class represents a file, which can be included into other files using the @ syntax.
Definition:
includer.hpp:32
Includer::m_type
int m_type
Definition:
includer.hpp:45
Includer::getIncludedFileName
std::string getIncludedFileName() const
Returns the embedded file name.
Definition:
includer.cpp:300
Includer::nIncludeLine
int nIncludeLine
Definition:
includer.hpp:44
Includer::Includer
Includer(const std::string &sIncludingString, const std::string &sSearchPath)
Includer class constructor. Opens the included file defined by the passed including string.
Definition:
includer.cpp:137
Includer::openIncludedFile
void openIncludedFile(const std::string &sIncludingString)
Opens the included file and determines the including type.
Definition:
includer.cpp:33
Includer::~Includer
~Includer()
Includer class destructor. Frees up internal memory if needed.
Definition:
includer.cpp:154
Includer::IncludeType
IncludeType
Definition:
includer.hpp:35
Includer::INCLUDE_ALL
@ INCLUDE_ALL
Definition:
includer.hpp:36
Includer::INCLUDE_GLOBALS
@ INCLUDE_GLOBALS
Definition:
includer.hpp:39
Includer::INCLUDE_DECLARATIONS
@ INCLUDE_DECLARATIONS
Definition:
includer.hpp:38
Includer::INCLUDE_DEFINES
@ INCLUDE_DEFINES
Definition:
includer.hpp:37
Includer::getIncludedType
int getIncludedType() const
Definition:
includer.hpp:58
Includer::is_open
bool is_open() const
Determine, if the internal included file is open and valid.
Definition:
includer.cpp:285
Includer::m_include
StyledTextFile * m_include
Definition:
includer.hpp:43
Includer::is_including_syntax
static bool is_including_syntax(const std::string &sLine)
Static member function which determines, whether the passed line is actually a including syntax.
Definition:
includer.cpp:318
Includer::getCurrentLine
int getCurrentLine() const
Definition:
includer.hpp:53
Includer::getNextLine
std::string getNextLine()
Return the next line of the included string.
Definition:
includer.cpp:168
StyledTextFile
This class represents a text file in memory (e.g. a code file). This class will try to lex the loaded...
Definition:
styledtextfile.hpp:41
kernel
core
procedure
includer.hpp
Generated by
1.9.3