The Battle for Wesnoth  1.15.2+dev
Public Member Functions | Private Attributes | List of all members
preprocessor_file Class Reference

Specialized preprocessor for handling a file or a set of files. More...

Inheritance diagram for preprocessor_file:
Inheritance graph

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_streambufparent_
 

Detailed Description

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 566 of file preprocessor.cpp.

Constructor & Destructor Documentation

◆ preprocessor_file()

preprocessor_file::preprocessor_file ( preprocessor_streambuf t,
const std::string &  name,
std::size_t  symbol_index = -1 
)

Member Function Documentation

◆ get_chunk()

virtual bool preprocessor_file::get_chunk ( )
inlineoverridevirtual

Inserts and processes the next file in the list of included files.

Returns
false if there is no next file.

Implements preprocessor.

Definition at line 578 of file preprocessor.cpp.

References preprocessor_streambuf::add_preprocessor(), and preprocessor::parent_.

◆ init()

void preprocessor_file::init ( )
overridevirtual

Allows specifying any actions that need to be called after the constructor completes.

Reimplemented from preprocessor.

Definition at line 779 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_.

Member Data Documentation

◆ end_

std::vector<std::string>::const_iterator preprocessor_file::end_
private

Definition at line 598 of file preprocessor.cpp.

Referenced by preprocessor_file().

◆ files_

std::vector<std::string> preprocessor_file::files_
private

Definition at line 597 of file preprocessor.cpp.

Referenced by preprocessor_file().

◆ is_directory_

bool preprocessor_file::is_directory_
private

Definition at line 602 of file preprocessor.cpp.

Referenced by init(), and preprocessor_file().

◆ name_

const std::string& preprocessor_file::name_
private

Definition at line 600 of file preprocessor.cpp.

Referenced by init().

◆ pos_

std::vector<std::string>::const_iterator preprocessor_file::pos_
private

Definition at line 598 of file preprocessor.cpp.

Referenced by preprocessor_file().


The documentation for this class was generated from the following file: