NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
This class represents a file, which can be included into other files using the @
syntax.
More...
#include <includer.hpp>
Public Types | |
enum | IncludeType { INCLUDE_ALL = 0x0 , INCLUDE_DEFINES = 0x1 , INCLUDE_DECLARATIONS = 0x2 , INCLUDE_GLOBALS = 0x4 } |
Public Member Functions | |
Includer (const std::string &sIncludingString, const std::string &sSearchPath) | |
Includer class constructor. Opens the included file defined by the passed including string. More... | |
~Includer () | |
Includer class destructor. Frees up internal memory if needed. More... | |
int | getCurrentLine () const |
int | getIncludedType () const |
std::string | getNextLine () |
Return the next line of the included string. More... | |
bool | is_open () const |
Determine, if the internal included file is open and valid. More... | |
std::string | getIncludedFileName () const |
Returns the embedded file name. 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 bool | is_including_syntax (const std::string &sLine) |
Static member function which determines, whether the passed line is actually a including syntax. More... | |
Private Member Functions | |
void | openIncludedFile (const std::string &sIncludingString) |
Opens the included file and determines the including type. More... | |
Private Attributes | |
StyledTextFile * | m_include |
int | nIncludeLine |
int | m_type |
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 represents a file, which can be included into other files using the @
syntax.
Definition at line 31 of file includer.hpp.
Enumerator | |
---|---|
INCLUDE_ALL | |
INCLUDE_DEFINES | |
INCLUDE_DECLARATIONS | |
INCLUDE_GLOBALS |
Definition at line 34 of file includer.hpp.
Includer::Includer | ( | const std::string & | sIncludingString, |
const std::string & | sSearchPath | ||
) |
Includer class constructor. Opens the included file defined by the passed including string.
sIncludingString | const std::string& |
sSearchPath | const std::string& |
Definition at line 137 of file includer.cpp.
References NumeReKernel::getInstance(), FileSystem::getPath(), FileSystem::getProgramPath(), FileSystem::initializeFromKernel(), openIncludedFile(), and FileSystem::setPath().
Includer::~Includer | ( | ) |
Includer class destructor. Frees up internal memory if needed.
Definition at line 154 of file includer.cpp.
References m_include.
|
inline |
Definition at line 53 of file includer.hpp.
References nIncludeLine.
std::string Includer::getIncludedFileName | ( | ) | const |
Returns the embedded file name.
Definition at line 300 of file includer.cpp.
References StyledTextFile::getFileName(), is_open(), and m_include.
Referenced by resolveIncludes().
|
inline |
Definition at line 58 of file includer.hpp.
References m_type.
std::string Includer::getNextLine | ( | ) |
Return the next line of the included string.
Definition at line 168 of file includer.cpp.
References findCommand(), StyledTextFile::getLinesCount(), StyledTextFile::getStrippedLine(), INCLUDE_DECLARATIONS, INCLUDE_DEFINES, INCLUDE_GLOBALS, is_open(), m_include, m_type, nIncludeLine, Match::sString, StripSpaces(), and SYMDEF_COMMAND.
Referenced by CodeAnalyzer::analyseCommands().
|
static |
Static member function which determines, whether the passed line is actually a including syntax.
sLine | const std::string& |
Definition at line 318 of file includer.cpp.
References findCommand().
Referenced by Script::handleIncludeSyntax(), parseLayoutScript(), ProcedureElement::ProcedureElement(), and resolveIncludes().
bool Includer::is_open | ( | ) | const |
Determine, if the internal included file is open and valid.
Definition at line 285 of file includer.cpp.
References m_include.
Referenced by CodeAnalyzer::analyseCommands(), getIncludedFileName(), and getNextLine().
|
private |
Opens the included file and determines the including type.
sIncludingString | const std::string& |
Definition at line 33 of file includer.cpp.
References _lang, findCommand(), Language::get(), StyledTextFile::getLastPosition(), INCLUDE_DECLARATIONS, INCLUDE_DEFINES, INCLUDE_GLOBALS, SyntaxError::INCLUDE_NOT_EXIST, SyntaxError::invalid_position, NumeReKernel::issueWarning(), m_include, m_type, Match::nPos, Match::sString, StripSpaces(), and FileSystem::ValidFileName().
Referenced by Includer().
|
private |
Definition at line 43 of file includer.hpp.
Referenced by getIncludedFileName(), getNextLine(), is_open(), openIncludedFile(), and ~Includer().
|
private |
Definition at line 45 of file includer.hpp.
Referenced by getIncludedType(), getNextLine(), and openIncludedFile().
|
private |
Definition at line 44 of file includer.hpp.
Referenced by getCurrentLine(), and getNextLine().