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>
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 |
Read/Write & analyze WML- and config-files.
Definition in file parser.cpp.
| #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.
| 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()().

| void read | ( | config & | cfg, | |
| std::istream & | in, | |||
| abstract_validator * | validator | |||
| ) |
Definition at line 372 of file parser.cpp.
Referenced by preferences::base_manager::base_manager(), get_addon_info(), init_mparams(), savegame::save_index::load(), persist_file_context::load(), cutter::load_config(), load_language_list(), main(), preprocess_resource(), process_command_args(), server::read_config(), schema_validation::schema_validator::read_config_file(), game_config::config_cache::read_configs(), input_stream::read_line(), wesnothd::room_manager::read_rooms(), savegame::manager::read_save_file(), refresh_addon_version_info_cache(), and help::help_text_area::set_items().

| 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 | |||
| ) |
Definition at line 383 of file parser.cpp.
Referenced by network_asio::connection::handle_read(), savegame::save_index::load(), ana_network_manager::read_config(), game_config::config_cache::read_file(), wesnothd::room_manager::read_rooms(), and savegame::manager::read_save_file().

| 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().


| 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().

| 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().


| 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().


| 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().

| 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().

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().
| Generated by doxygen 1.7.1 on Sat Feb 4 2012 01:09:47 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |