NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
symdef.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 SYMDEF_HPP
20#define SYMDEF_HPP
21#define SYMDEF_COMMAND "declare"
22
23#include <string>
24#include <map>
25
32{
33 private:
34 std::map<std::string, std::string> m_symDefs;
35
36 public:
38
39 void resolveSymbols(std::string& sCommandLine) const;
40 void createSymbol(const std::string& sCommandLine);
41 bool isSymbol(const std::string& sSymbol) const;
42 void clear();
43};
44
45#endif // SYMDEF_HPP
46
47
This class handles the file-static constants, which are more or less macros similar to #define in C/C...
Definition: symdef.hpp:32
void resolveSymbols(std::string &sCommandLine) const
Resolve all file-static constant declarations in the current line.
Definition: symdef.cpp:47
void clear()
Remove all file-static constant declarations.
Definition: symdef.cpp:33
bool isSymbol(const std::string &sSymbol) const
Check, whether the passed string is a defined symbol (will be used by the static code analyzer).
Definition: symdef.cpp:117
void createSymbol(const std::string &sCommandLine)
Create one or more new file-static constant declarations for the current file.
Definition: symdef.cpp:72
std::map< std::string, std::string > m_symDefs
Definition: symdef.hpp:34