Specialized preprocessor for handling a file or a set of files. More...
Public Member Functions | |
preprocessor_file (preprocessor_streambuf &t, const std::string &name, std::size_t symbol_index=-1) | |
Constructor. More... | |
virtual void | init () override |
Allows specifying any actions that need to be called after the constructor completes. More... | |
virtual bool | get_chunk () override |
Inserts and processes the next file in the list of included files. More... | |
Public Member Functions inherited from preprocessor | |
virtual | ~preprocessor () |
virtual MODE | parse_mode () |
Returns the appropriate parsing mode for this preprocessor. More... | |
Private Attributes | |
std::vector< std::string > | files_ |
std::vector< std::string >::const_iterator | pos_ |
std::vector< std::string >::const_iterator | end_ |
const std::string & | name_ |
bool | is_directory_ |
Additional Inherited Members | |
Public Types inherited from preprocessor | |
enum | MODE { NO_PARSING , PARSES_FILE , PARSES_MACRO } |
Protected Member Functions inherited from preprocessor | |
preprocessor (preprocessor_streambuf &t) | |
Sets up a new preprocessor for stream buffer t. More... | |
Protected Attributes inherited from preprocessor | |
preprocessor_streambuf & | parent_ |
Specialized preprocessor for handling a file or a set of files.
A preprocessor_file object is created when a preprocessor encounters an inclusion directive that resolves to a file or directory, e.g. '{themes/}'.
Definition at line 597 of file preprocessor.cpp.
preprocessor_file::preprocessor_file | ( | preprocessor_streambuf & | t, |
const std::string & | name, | ||
std::size_t | symbol_index = -1 |
||
) |
Constructor.
preprocessor_file constructor.
It relies on preprocessor_data so it's implemented after that class is declared.
Definition at line 774 of file preprocessor.cpp.
References filesystem::base_name(), filesystem::directory_name(), filesystem::DO_REORDER, end_, filesystem::ENTIRE_FILE_PATH, preprocessor_streambuf::error(), files_, filesystem::get_files_in_dir(), is_directory_, preprocessor::parent_, pos_, and filesystem::SKIP_MEDIA_DIR.
|
inlineoverridevirtual |
Inserts and processes the next file in the list of included files.
Implements preprocessor.
Definition at line 609 of file preprocessor.cpp.
References preprocessor_streambuf::add_preprocessor(), end_, preprocessor::parent_, and pos_.
|
overridevirtual |
Allows specifying any actions that need to be called after the constructor completes.
Reimplemented from preprocessor.
Definition at line 810 of file preprocessor.cpp.
References preprocessor_streambuf::add_preprocessor(), filesystem::directory_name(), ERR_PREPROC, filesystem::get_short_wml_path(), is_directory_, filesystem::istream_file(), name_, preprocessor::parent_, and preprocessor_streambuf::textdomain_.
|
private |
Definition at line 629 of file preprocessor.cpp.
Referenced by get_chunk(), and preprocessor_file().
|
private |
Definition at line 628 of file preprocessor.cpp.
Referenced by preprocessor_file().
|
private |
Definition at line 633 of file preprocessor.cpp.
Referenced by init(), and preprocessor_file().
|
private |
Definition at line 631 of file preprocessor.cpp.
Referenced by init().
|
private |
Definition at line 629 of file preprocessor.cpp.
Referenced by get_chunk(), and preprocessor_file().