The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
preprocessor_streambuf Class Reference

Target for sending preprocessed output. More...

Inheritance diagram for preprocessor_streambuf:
Inheritance graph

Public Member Functions

std::string get_current_file ()
 
 preprocessor_streambuf (preproc_map *)
 
void error (const std::string &, int)
 
void warning (const std::string &, int)
 

Private Member Functions

virtual int underflow ()
 Called by an STL stream whenever it has reached the end of out_buffer_. More...
 
 preprocessor_streambuf (preprocessor_streambuf const &)
 

Private Attributes

std::string out_buffer_
 Buffer read by the STL stream. More...
 
std::stringstream buffer_
 Buffer filled by the current_ preprocessor. More...
 
preprocessorcurrent_
 Input preprocessor. More...
 
preproc_mapdefines_
 
preproc_map default_defines_
 
std::string textdomain_
 
std::string location_
 
int linenum_
 
int depth_
 
bool quoted_
 Set to true if one preprocessor for this target started to read a string. More...
 

Friends

class preprocessor
 
class preprocessor_file
 
class preprocessor_data
 
struct preprocessor_deleter
 

Detailed Description

Target for sending preprocessed output.

Objects of this class can be plugged into an STL stream.

Definition at line 221 of file preprocessor.cpp.

Constructor & Destructor Documentation

preprocessor_streambuf::preprocessor_streambuf ( preprocessor_streambuf const &  t)
private

Definition at line 286 of file preprocessor.cpp.

preprocessor_streambuf::preprocessor_streambuf ( preproc_map def)

Definition at line 271 of file preprocessor.cpp.

Member Function Documentation

void preprocessor_streambuf::error ( const std::string error_type,
int  l 
)
std::string preprocessor_streambuf::get_current_file ( )
int preprocessor_streambuf::underflow ( )
privatevirtual

Called by an STL stream whenever it has reached the end of out_buffer_.

Fills buffer_ by calling the current_ preprocessor, then copies its content into out_buffer_.

Returns
the first character of out_buffer_ if any, EOF otherwise.

Definition at line 307 of file preprocessor.cpp.

References buffer_, current_, preprocessor::get_chunk(), and out_buffer_.

void preprocessor_streambuf::warning ( const std::string warning_type,
int  l 
)

Definition at line 386 of file preprocessor.cpp.

References lineno_string(), location_, pos, and WRN_PREPROC.

Referenced by preprocessor_data::get_chunk().

Friends And Related Function Documentation

friend class preprocessor
friend

Definition at line 238 of file preprocessor.cpp.

friend class preprocessor_data
friend

Definition at line 240 of file preprocessor.cpp.

friend struct preprocessor_deleter
friend

Definition at line 241 of file preprocessor.cpp.

friend class preprocessor_file
friend

Definition at line 239 of file preprocessor.cpp.

Member Data Documentation

std::stringstream preprocessor_streambuf::buffer_
private

Buffer filled by the current_ preprocessor.

Definition at line 225 of file preprocessor.cpp.

Referenced by preprocessor_data::preprocessor_data(), preprocessor_data::put(), underflow(), and preprocessor::~preprocessor().

preprocessor* preprocessor_streambuf::current_
private

Input preprocessor.

Definition at line 226 of file preprocessor.cpp.

Referenced by get_current_file(), preprocessor::preprocessor(), underflow(), and preprocessor::~preprocessor().

preproc_map preprocessor_streambuf::default_defines_
private

Definition at line 228 of file preprocessor.cpp.

preproc_map* preprocessor_streambuf::defines_
private

Definition at line 227 of file preprocessor.cpp.

Referenced by preprocessor_data::get_chunk().

int preprocessor_streambuf::depth_
private
int preprocessor_streambuf::linenum_
private
std::string preprocessor_streambuf::location_
private
std::string preprocessor_streambuf::out_buffer_
private

Buffer read by the STL stream.

Definition at line 223 of file preprocessor.cpp.

Referenced by underflow().

bool preprocessor_streambuf::quoted_
private

Set to true if one preprocessor for this target started to read a string.

Deeper-nested preprocessors are then forbidden to.

Definition at line 237 of file preprocessor.cpp.

Referenced by preprocessor_data::get_chunk().

std::string preprocessor_streambuf::textdomain_
private

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