The Battle for Wesnoth  1.15.1+dev
Classes | Typedefs | Functions
preprocessor.hpp File Reference
#include "filesystem.hpp"
#include <iosfwd>
#include <map>
#include <vector>
#include <boost/optional.hpp>
#include "exceptions.hpp"
#include "game_version.hpp"
#include "deprecation.hpp"
Include dependency graph for preprocessor.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  preproc_define
 
struct  preproc_config
 
struct  preproc_config::error
 

Typedefs

typedef std::map< std::string, struct preproc_definepreproc_map
 

Functions

std::ostream & operator<< (std::ostream &stream, const preproc_define &def)
 
std::string lineno_string (const std::string &lineno)
 
std::ostream & operator<< (std::ostream &stream, const preproc_map::value_type &def)
 
filesystem::scoped_istream preprocess_file (const std::string &fname, preproc_map *defines=nullptr)
 Function to use the WML preprocessor on a file. More...
 
void preprocess_resource (const std::string &res_name, preproc_map *defines_map, bool write_cfg=false, bool write_plain_cfg=false, const std::string &target_directory="")
 

Typedef Documentation

◆ preproc_map

typedef std::map<std::string, struct preproc_define> preproc_map

Definition at line 31 of file preprocessor.hpp.

Function Documentation

◆ lineno_string()

std::string lineno_string ( const std::string &  lineno)

◆ operator<<() [1/2]

std::ostream& operator<< ( std::ostream &  stream,
const preproc_define def 
)

◆ operator<<() [2/2]

std::ostream& operator<< ( std::ostream &  stream,
const preproc_map::value_type &  def 
)

Definition at line 209 of file preprocessor.cpp.

◆ preprocess_file()

filesystem::scoped_istream preprocess_file ( const std::string &  fname,
preproc_map defines = nullptr 
)

Function to use the WML preprocessor on a file.

Parameters
definesA map of symbols defined.
Returns
The resulting preprocessed file data.

Referenced by preproc_config::error::error().

◆ preprocess_resource()

void preprocess_resource ( const std::string &  res_name,
preproc_map defines_map,
bool  write_cfg = false,
bool  write_plain_cfg = false,
const std::string &  target_directory = "" 
)