Target for sending preprocessed output. More...
Public Member Functions | |
preprocessor_streambuf (preproc_map *def) | |
std::string | get_current_file () |
Decodes the filenames placed in a location. More... | |
void | error (const std::string &, int) |
void | warning (const std::string &, int) |
template<typename T , typename... A> | |
void | add_preprocessor (A &&... args) |
void | drop_preprocessor () |
int | depth () const |
preprocessor * | current () const |
Private Member Functions | |
preprocessor_streambuf (const preprocessor_streambuf &t) | |
virtual int | underflow () override |
Inherited from basic_streambuf. More... | |
void | restore_old_preprocessor () |
Restores the old preprocessing context. More... | |
Private Attributes | |
std::string | out_buffer_ |
Buffer read by the STL stream. More... | |
std::stringstream | buffer_ |
Buffer filled by the current preprocessor. More... | |
std::deque< std::unique_ptr< preprocessor > > | preprocessor_queue_ |
Input preprocessor queue. More... | |
preproc_map * | defines_ |
preproc_map | default_defines_ |
std::string | textdomain_ |
std::string | location_ |
int | linenum_ |
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_scope_helper |
Target for sending preprocessed output.
Objects of this class can be plugged into an STL stream.
Definition at line 311 of file preprocessor.cpp.
|
inline |
Definition at line 314 of file preprocessor.cpp.
|
inlineprivate |
Definition at line 357 of file preprocessor.cpp.
|
inline |
Definition at line 335 of file preprocessor.cpp.
References preprocessor_queue_.
Referenced by preprocessor_file::get_chunk(), preprocessor_data::get_chunk(), and preprocessor_file::init().
|
inline |
Definition at line 351 of file preprocessor.cpp.
References preprocessor_queue_.
Referenced by restore_old_preprocessor(), and underflow().
|
inline |
Definition at line 346 of file preprocessor.cpp.
References preprocessor_queue_.
Referenced by preprocessor_data::get_chunk().
|
inline |
Definition at line 341 of file preprocessor.cpp.
References preprocessor_queue_.
Referenced by restore_old_preprocessor().
void preprocessor_streambuf::error | ( | const std::string & | error_type, |
int | l | ||
) |
Definition at line 557 of file preprocessor.cpp.
References ERR_PREPROC, lineno_string(), and location_.
Referenced by preprocessor_data::get_chunk(), and preprocessor_file::preprocessor_file().
std::string preprocessor_streambuf::get_current_file | ( | ) |
Decodes the filenames placed in a location.
Definition at line 498 of file preprocessor.cpp.
References get_filename(), location_, p, preprocessor::parse_mode(), preprocessor::PARSES_FILE, preprocessor::PARSES_MACRO, preprocessor_queue_, and utils::quoted_split().
Referenced by preprocessor_data::get_chunk().
|
private |
Restores the old preprocessing context.
Appends location and domain directives to the buffer, so that the parser notices these changes.
Definition at line 478 of file preprocessor.cpp.
References buffer_, current(), drop_preprocessor(), INLINED_PREPROCESS_DIRECTIVE_CHAR, linenum_, location_, preprocessor::old_linenum_, preprocessor::old_location_, preprocessor::old_textdomain_, and textdomain_.
Referenced by underflow().
|
overrideprivatevirtual |
Inherited from basic_streambuf.
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_.
Definition at line 420 of file preprocessor.cpp.
References buffer_, current(), out_buffer_, and restore_old_preprocessor().
void preprocessor_streambuf::warning | ( | const std::string & | warning_type, |
int | l | ||
) |
Definition at line 573 of file preprocessor.cpp.
References lineno_string(), location_, and WRN_PREPROC.
Referenced by preprocessor_data::get_chunk().
|
friend |
Definition at line 399 of file preprocessor.cpp.
|
friend |
Definition at line 401 of file preprocessor.cpp.
|
friend |
Definition at line 400 of file preprocessor.cpp.
|
friend |
Definition at line 402 of file preprocessor.cpp.
|
private |
Buffer filled by the current preprocessor.
Definition at line 380 of file preprocessor.cpp.
Referenced by preprocessor_data::put(), restore_old_preprocessor(), and underflow().
|
private |
Definition at line 386 of file preprocessor.cpp.
|
private |
Definition at line 385 of file preprocessor.cpp.
Referenced by preprocessor_data::get_chunk().
|
private |
Definition at line 391 of file preprocessor.cpp.
Referenced by preprocessor_data::put(), and restore_old_preprocessor().
|
private |
Definition at line 389 of file preprocessor.cpp.
Referenced by error(), preprocessor_data::get_chunk(), get_current_file(), preprocessor_data::push_token(), preprocessor_data::put(), restore_old_preprocessor(), and warning().
|
private |
Buffer read by the STL stream.
Definition at line 377 of file preprocessor.cpp.
Referenced by underflow().
|
private |
Input preprocessor queue.
Definition at line 383 of file preprocessor.cpp.
Referenced by add_preprocessor(), current(), depth(), drop_preprocessor(), and get_current_file().
|
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 397 of file preprocessor.cpp.
Referenced by preprocessor_data::get_chunk().
|
private |
Definition at line 388 of file preprocessor.cpp.
Referenced by preprocessor_data::get_chunk(), preprocessor_file::init(), preprocessor_data::push_token(), and restore_old_preprocessor().