The Battle for Wesnoth  1.19.5+dev
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
preprocessor Class Referenceabstract

Base class for preprocessing an input. More...

Inheritance diagram for preprocessor:

Public Types

enum  MODE { NO_PARSING , PARSES_FILE , PARSES_MACRO }
 

Public Member Functions

virtual ~preprocessor ()
 
virtual void init ()
 Allows specifying any actions that need to be called after the constructor completes. More...
 
virtual bool get_chunk ()=0
 Preprocesses and sends some text to the parent_ buffer. More...
 
virtual MODE parse_mode ()
 Returns the appropriate parsing mode for this preprocessor. More...
 

Protected Member Functions

 preprocessor (preprocessor_streambuf &t)
 Sets up a new preprocessor for stream buffer t. More...
 

Protected Attributes

preprocessor_streambufparent_
 

Private Attributes

std::string old_textdomain_
 
std::string old_location_
 
int old_linenum_
 

Friends

class preprocessor_streambuf
 

Detailed Description

Base class for preprocessing an input.

Definition at line 256 of file preprocessor.cpp.

Member Enumeration Documentation

◆ MODE

Enumerator
NO_PARSING 
PARSES_FILE 
PARSES_MACRO 

Definition at line 287 of file preprocessor.cpp.

Constructor & Destructor Documentation

◆ preprocessor()

preprocessor::preprocessor ( preprocessor_streambuf t)
protected

Sets up a new preprocessor for stream buffer t.

Preprocessor constructor.

Saves the current preprocessing context of parent_. It will be automatically restored on destruction.

It relies on preprocessor_streambuf so it's implemented after that class is declared.

Definition at line 406 of file preprocessor.cpp.

◆ ~preprocessor()

virtual preprocessor::~preprocessor ( )
inlinevirtual

Definition at line 272 of file preprocessor.cpp.

Member Function Documentation

◆ get_chunk()

virtual bool preprocessor::get_chunk ( )
pure virtual

Preprocesses and sends some text to the parent_ buffer.

Returns
false when the input has no data left.

Implemented in preprocessor_data, and preprocessor_file.

◆ init()

virtual void preprocessor::init ( )
inlinevirtual

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

Reimplemented in preprocessor_file.

Definition at line 277 of file preprocessor.cpp.

◆ parse_mode()

virtual MODE preprocessor::parse_mode ( )
inlinevirtual

Returns the appropriate parsing mode for this preprocessor.

Reimplemented in preprocessor_data.

Definition at line 290 of file preprocessor.cpp.

References NO_PARSING.

Referenced by preprocessor_streambuf::get_current_file().

Friends And Related Function Documentation

◆ preprocessor_streambuf

friend class preprocessor_streambuf
friend

Definition at line 258 of file preprocessor.cpp.

Referenced by preprocessor_data::get_chunk().

Member Data Documentation

◆ old_linenum_

int preprocessor::old_linenum_
private

Definition at line 299 of file preprocessor.cpp.

Referenced by preprocessor_streambuf::restore_old_preprocessor().

◆ old_location_

std::string preprocessor::old_location_
private

Definition at line 297 of file preprocessor.cpp.

Referenced by preprocessor_streambuf::restore_old_preprocessor().

◆ old_textdomain_

std::string preprocessor::old_textdomain_
private

Definition at line 296 of file preprocessor.cpp.

Referenced by preprocessor_streambuf::restore_old_preprocessor().

◆ parent_

preprocessor_streambuf& preprocessor::parent_
protected

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