#include "serialization/parser.hpp"
#include "config.hpp"
#include "filesystem.hpp"
#include "gettext.hpp"
#include "language.hpp"
#include "loadscreen.hpp"
#include "log.hpp"
#include "util.hpp"
#include "wesconfig.h"
#include "serialization/binary_wml.hpp"
#include "serialization/preprocessor.hpp"
#include "serialization/string_utils.hpp"
#include "serialization/tokenizer.hpp"
#include <cassert>
#include <sstream>
#include <stack>
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/filter/gzip.hpp>
Go to the source code of this file.
Defines | |
#define | ERR_CF LOG_STREAM(err, config) |
#define | WRN_CF LOG_STREAM(warn, config) |
#define | LOG_CF LOG_STREAM(info, config) |
Functions | |
void | read (config &cfg, std::istream &in, std::string *error_log) |
void | read (config &cfg, std::string &in, std::string *error_log) |
void | read_gz (config &cfg, std::istream &file, std::string *error_log) |
static std::string | escaped_string (const std::string &value) |
void | write_key_val (std::ostream &out, const std::string &key, const t_string &value, unsigned int 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) |
Variables | |
static const size_t | max_recursion_levels = 1000 |
static char const * | AttributeEquals = "=" |
static char const * | TranslatableAttributePrefix = "_ \"" |
static char const * | AttributePrefix = "\"" |
static char const * | AttributePostfix = "\"" |
static char const * | AttributeContPostfix = " + \n" |
static char const * | AttributeEndPostfix = "\n" |
static char const * | TextdomainPrefix = "#textdomain " |
static char const * | TextdomainPostfix = "\n" |
static char const * | ElementPrefix = "[" |
static char const * | ElementPostfix = "]\n" |
static char const * | EndElementPrefix = "[/" |
static char const * | EndElementPostfix = "]\n" |
Definition in file parser.cpp.
#define ERR_CF LOG_STREAM(err, config) |
Definition at line 42 of file parser.cpp.
#define LOG_CF LOG_STREAM(info, config) |
Definition at line 44 of file parser.cpp.
#define WRN_CF LOG_STREAM(warn, config) |
Definition at line 43 of file parser.cpp.
static std::string escaped_string | ( | const std::string & | value | ) | [static] |
void read | ( | config & | cfg, | |
std::string & | in, | |||
std::string * | error_log | |||
) |
Definition at line 350 of file parser.cpp.
void read | ( | config & | cfg, | |
std::istream & | in, | |||
std::string * | error_log | |||
) |
Definition at line 345 of file parser.cpp.
Referenced by preferences::base_manager::base_manager(), detect_format_and_read(), get_campaign_info(), cutter::load_config(), font::load_font_config(), load_language_list(), gui2::load_settings(), main(), map_editor::map_editor(), server::read_config(), input_stream::read_line(), read_tips_of_day(), help::help_text_area::set_items(), and set_language().
void read_gz | ( | config & | cfg, | |
std::istream & | file, | |||
std::string * | error_log | |||
) |
void write | ( | std::ostream & | out, | |
config const & | cfg, | |||
unsigned int | level | |||
) |
Definition at line 475 of file parser.cpp.
References PACKAGE, and write_internal().
Referenced by help::help_text_area::handle_ref_cfg(), set_campaign_info(), write_possibly_compressed(), preferences::write_preferences(), map_editor::~map_editor(), and upload_log::~upload_log().
void write_close_child | ( | std::ostream & | out, | |
const std::string & | child, | |||
unsigned int | level | |||
) |
Definition at line 449 of file parser.cpp.
Referenced by config_writer::close_child(), and write_internal().
static void write_internal | ( | config const & | cfg, | |
std::ostream & | out, | |||
std::string & | textdomain, | |||
size_t | tab = 0 | |||
) | [static] |
Definition at line 455 of file parser.cpp.
References max_recursion_levels, name, config::ordered_begin(), config::ordered_end(), config::values, 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 t_string & | value, | |||
unsigned int | level, | |||
std::string & | textdomain | |||
) |
Definition at line 392 of file parser.cpp.
References t_string::empty(), and escaped_string().
Referenced by write_internal().
void write_open_child | ( | std::ostream & | out, | |
const std::string & | child, | |||
unsigned int | level | |||
) |
Definition at line 443 of file parser.cpp.
Referenced by config_writer::open_child(), and write_internal().
char const* AttributeContPostfix = " + \n" [static] |
Definition at line 371 of file parser.cpp.
char const* AttributeEndPostfix = "\n" [static] |
Definition at line 372 of file parser.cpp.
char const* AttributeEquals = "=" [static] |
Definition at line 365 of file parser.cpp.
char const* AttributePostfix = "\"" [static] |
Definition at line 369 of file parser.cpp.
char const* AttributePrefix = "\"" [static] |
Definition at line 368 of file parser.cpp.
Definition at line 80 of file parser.cpp.
Referenced by replay::add_chat_log_entry(), terrain_builder::add_off_map_rule(), animated< T, T_void_value >::animated(), attack::attack(), turn_info::change_side_controller(), events::menu_handler::change_side_controller(), replay_network_sender::commit_and_sync(), construct_error(), construct_message(), do_replay_handle(), events::console_handler::do_unit(), unit_abilities::effect::effect(), unit_type_data::unit_type_map_wrapper::find_config(), font::load_font_config(), load_game(), dialogs::load_game_dialog(), load_game_summary(), load_language_list(), gui2::load_settings(), main(), map_editor::new_map_dialog(), game::notify_new_host(), open_connection(), gamemap::overlay(), cave_map_generator::place_items(), play_game(), playmp_controller::play_human_turn(), playmp_controller::play_network_turn(), playsingle_controller::play_scenario(), mp::connect::process_event(), recruit_unit(), mp::wait::request_snapshot(), save_summary(), events::menu_handler::send_chat_message(), game::send_observerjoins(), game::send_server_message(), game::send_user_list(), help::help_text_area::set_items(), set_language(), turn_info::sync_network(), replay_network_sender::sync_non_undoable(), game::take_side(), and playmp_controller::wait_for_upload().
Definition at line 68 of file parser.cpp.
char const* ElementPostfix = "]\n" [static] |
Definition at line 378 of file parser.cpp.
char const* ElementPrefix = "[" [static] |
Definition at line 377 of file parser.cpp.
std::stack<element> elements |
Definition at line 87 of file parser.cpp.
char const* EndElementPostfix = "]\n" [static] |
Definition at line 380 of file parser.cpp.
char const* EndElementPrefix = "[/" [static] |
Definition at line 379 of file parser.cpp.
std::map<std::string, config*> last_element_map |
Definition at line 83 of file parser.cpp.
const size_t max_recursion_levels = 1000 [static] |
Definition at line 46 of file parser.cpp.
std::string name |
Definition at line 81 of file parser.cpp.
std::string start_line |
Definition at line 84 of file parser.cpp.
char const* TextdomainPostfix = "\n" [static] |
Definition at line 375 of file parser.cpp.
char const* TextdomainPrefix = "#textdomain " [static] |
Definition at line 374 of file parser.cpp.
Definition at line 69 of file parser.cpp.
char const* TranslatableAttributePrefix = "_ \"" [static] |
Definition at line 367 of file parser.cpp.
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |