Classes | Defines | Functions | Variables

serialization/parser.cpp File Reference

Read/Write & analyze WML- and config-files. More...

#include "serialization/parser.hpp"
#include "config.hpp"
#include "log.hpp"
#include "gettext.hpp"
#include "loadscreen.hpp"
#include "wesconfig.h"
#include "serialization/preprocessor.hpp"
#include "serialization/tokenizer.hpp"
#include "serialization/string_utils.hpp"
#include "serialization/validator.hpp"
#include "foreach.hpp"
#include <stack>
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/filter/gzip.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/variant.hpp>
Include dependency graph for parser.cpp:

Go to the source code of this file.

Classes

struct  write_key_val_visitor

Defines

#define ERR_CF   LOG_STREAM(err, log_config)
#define WRN_CF   LOG_STREAM(warn, log_config)
#define LOG_CF   LOG_STREAM(info, log_config)

Functions

void read (config &cfg, std::istream &in, abstract_validator *validator)
void read (config &cfg, std::string &in, abstract_validator *validator)
void read_gz (config &cfg, std::istream &file, abstract_validator *validator)
static std::string escaped_string (const std::string &value)
void write_key_val (std::ostream &out, const std::string &key, const config::attribute_value &value, unsigned level, std::string &textdomain)
void write_open_child (std::ostream &out, const std::string &child, unsigned int level)
void write_close_child (std::ostream &out, const std::string &child, unsigned int level)
static void write_internal (config const &cfg, std::ostream &out, std::string &textdomain, size_t tab=0)
void write (std::ostream &out, config const &cfg, unsigned int level)
void write_gz (std::ostream &out, config const &cfg)

Variables

static lg::log_domain log_config ("config")
static const size_t max_recursion_levels = 1000

Detailed Description

Read/Write & analyze WML- and config-files.

Definition in file parser.cpp.


Define Documentation

#define ERR_CF   LOG_STREAM(err, log_config)

Definition at line 45 of file parser.cpp.

#define LOG_CF   LOG_STREAM(info, log_config)

Definition at line 47 of file parser.cpp.

#define WRN_CF   LOG_STREAM(warn, log_config)

Definition at line 46 of file parser.cpp.


Function Documentation

static std::string escaped_string ( const std::string &  value  )  [static]

Definition at line 397 of file parser.cpp.

Referenced by write_key_val_visitor::operator()().

Here is the caller graph for this function:

void read ( config cfg,
std::istream &  in,
abstract_validator validator 
)
void read ( config cfg,
std::string &  in,
abstract_validator validator 
)

Definition at line 377 of file parser.cpp.

void read_gz ( config cfg,
std::istream &  file,
abstract_validator validator 
)
void write ( std::ostream &  out,
config const &  cfg,
unsigned int  level 
)

Definition at line 509 of file parser.cpp.

References write_internal().

Referenced by ana_network_manager::compress_config(), help::help_text_area::handle_ref_cfg(), preprocess_resource(), set_addon_info(), network_asio::connection::transfer(), write_gz(), and savegame::save_index::write_save_index().

Here is the call graph for this function:

Here is the caller graph for this function:

void write_close_child ( std::ostream &  out,
const std::string &  child,
unsigned int  level 
)

Definition at line 487 of file parser.cpp.

Referenced by config_writer::close_child(), and write_internal().

Here is the caller graph for this function:

void write_gz ( std::ostream &  out,
config const &  cfg 
)

Definition at line 515 of file parser.cpp.

References write().

Referenced by network_asio::connection::transfer(), and savegame::save_index::write_save_index().

Here is the call graph for this function:

Here is the caller graph for this function:

static void write_internal ( config const &  cfg,
std::ostream &  out,
std::string &  textdomain,
size_t  tab = 0 
) [static]

Definition at line 492 of file parser.cpp.

References config::all_children_range(), config::attribute_range(), config::any_child::cfg, error(), config::any_child::key, max_recursion_levels, write_close_child(), write_key_val(), and write_open_child().

Referenced by write().

Here is the call graph for this function:

Here is the caller graph for this function:

void write_key_val ( std::ostream &  out,
const std::string &  key,
const config::attribute_value value,
unsigned  level,
std::string &  textdomain 
)

Definition at line 470 of file parser.cpp.

References config::attribute_value::value.

Referenced by write_internal().

Here is the caller graph for this function:

void write_open_child ( std::ostream &  out,
const std::string &  child,
unsigned int  level 
)

Definition at line 482 of file parser.cpp.

Referenced by config_writer::open_child(), and write_internal().

Here is the caller graph for this function:


Variable Documentation

lg::log_domain log_config("config") [static]
const size_t max_recursion_levels = 1000 [static]

Definition at line 49 of file parser.cpp.

Referenced by write_internal().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Sat Feb 4 2012 01:09:47 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs