#include <simple_wml.hpp>
Public Member Functions | |
document () | |
document (char *buf, INIT_BUFFER_CONTROL control=INIT_TAKE_OWNERSHIP) | |
document (const char *buf, INIT_STATE state) | |
document (string_span compressed_buf) | |
~document () | |
const char * | dup_string (const char *str) |
node & | root () |
const node & | root () const |
const char * | output () |
string_span | output_compressed (bool bzip2=false) |
void | compress () |
std::unique_ptr< document > | clone () |
const string_span & | operator[] (const char *key) const |
const string_span & | attr (const char *key) const |
node * | child (const char *name) |
const node * | child (const char *name) const |
const node::child_list & | children (const char *name) const |
node & | set_attr (const char *key, const char *value) |
node & | set_attr_dup (const char *key, const char *value) |
void | take_ownership_of_buffer (char *buffer) |
void | swap (document &o) |
void | clear () |
Static Public Member Functions | |
static std::string | stats () |
Static Public Attributes | |
static std::size_t | document_size_limit = 40000000 |
Private Member Functions | |
void | generate_root () |
document (const document &)=delete | |
document & | operator= (const document &)=delete |
void | attach_list () |
void | detach_list () |
Private Attributes | |
string_span | compressed_buf_ |
const char * | output_ |
std::vector< char * > | buffers_ |
node * | root_ |
document * | prev_ |
document * | next_ |
Definition at line 236 of file simple_wml.hpp.
simple_wml::document::document | ( | ) |
Definition at line 953 of file simple_wml.cpp.
References attach_list().
|
explicit |
Definition at line 964 of file simple_wml.cpp.
References attach_list(), buffers_, simple_wml::INIT_TAKE_OWNERSHIP, and root_.
simple_wml::document::document | ( | const char * | buf, |
INIT_STATE | state | ||
) |
Definition at line 981 of file simple_wml.cpp.
References attach_list(), simple_wml::INIT_COMPRESSED, output_, output_compressed(), and root_.
|
explicit |
Definition at line 999 of file simple_wml.cpp.
References attach_list(), simple_wml::string_span::begin(), buffers_, ERR_SWML, utils::get_unknown_exception_type(), output_, and root_.
simple_wml::document::~document | ( | ) |
Definition at line 1023 of file simple_wml.cpp.
References buffers_, detach_list(), i, and root_.
|
privatedelete |
|
private |
Definition at line 1170 of file simple_wml.cpp.
Referenced by document().
|
inline |
Definition at line 259 of file simple_wml.hpp.
References root().
|
inline |
Definition at line 263 of file simple_wml.hpp.
References simple_wml::node::child(), and root().
Referenced by server_base::async_send_error(), server_base::async_send_warning(), wesnothd::server::cleanup_game(), wesnothd::server::delete_game(), wesnothd::server::handle_join_game(), wesnothd::server::handle_player_in_game(), wesnothd::game::level_init(), wesnothd::make_add_diff(), wesnothd::make_change_diff(), wesnothd::make_delete_diff(), wesnothd::game::save_replay(), and wesnothd::server::update_game_in_lobby().
|
inline |
Definition at line 267 of file simple_wml.hpp.
References simple_wml::node::child(), and root().
|
inline |
Definition at line 271 of file simple_wml.hpp.
References simple_wml::node::children(), and root().
void simple_wml::document::clear | ( | ) |
Definition at line 1153 of file simple_wml.cpp.
References buffers_, compressed_buf_, i, output_, and root_.
std::unique_ptr< document > simple_wml::document::clone | ( | ) |
Definition at line 1135 of file simple_wml.cpp.
References output().
Referenced by server_base::async_send_doc_queued(), and wesnothd::game::change_controller_type().
void simple_wml::document::compress | ( | ) |
Definition at line 1102 of file simple_wml.cpp.
References simple_wml::string_span::begin(), buffers_, compressed_buf_, i, output_, output_compressed(), and root_.
Referenced by campaignd::server::handle_request_campaign(), campaignd::server::handle_request_campaign_list(), and campaignd::server::handle_server_id().
|
private |
Definition at line 1181 of file simple_wml.cpp.
Referenced by ~document().
const char * simple_wml::document::dup_string | ( | const char * | str | ) |
Definition at line 1035 of file simple_wml.cpp.
References buffers_.
Referenced by simple_wml::node::set_attr_dup().
|
private |
Definition at line 1121 of file simple_wml.cpp.
References simple_wml::string_span::begin(), buffers_, compressed_buf_, simple_wml::string_span::empty(), output_, and root_.
Referenced by root().
|
inline |
Definition at line 255 of file simple_wml.hpp.
References root().
const char * simple_wml::document::output | ( | ) |
Definition at line 1044 of file simple_wml.cpp.
References simple_wml::string_span::begin(), buffers_, compressed_buf_, e, simple_wml::string_span::empty(), ERR_SWML, i, simple_wml::node::is_dirty(), simple_wml::node::output(), output_, simple_wml::node::output_size(), simple_wml::node::REFRESH_CACHE, and root_.
Referenced by clone(), server_base::coro_send_doc(), output_compressed(), wesnothd::game::remove_player(), and wesnothd::game::save_replay().
string_span simple_wml::document::output_compressed | ( | bool | bzip2 = false | ) |
Definition at line 1088 of file simple_wml.cpp.
References simple_wml::string_span::begin(), buffers_, compressed_buf_, simple_wml::string_span::empty(), simple_wml::node::is_dirty(), output(), and root_.
Referenced by compress(), server_base::coro_send_doc(), and document().
|
inline |
Definition at line 245 of file simple_wml.hpp.
References generate_root(), and root_.
Referenced by wesnothd::game::add_player(), wesnothd::game::allow_observers(), server_base::async_send_error(), server_base::async_send_warning(), attr(), BOOST_AUTO_TEST_CASE(), wesnothd::game::change_controller_type(), child(), children(), wesnothd::server::delete_game(), wesnothd::server::dummy_player_updates(), wesnothd::game::get_replay_filename(), wesnothd::game::get_sides_list(), wesnothd::server::handle_join_game(), wesnothd::server::handle_message(), wesnothd::server::handle_player(), wesnothd::server::handle_player_in_game(), wesnothd::server::handle_whisper(), wesnothd::game::is_reload(), wesnothd::server::load_config(), wesnothd::game::load_next_scenario(), wesnothd::server::login_client(), wesnothd::make_add_diff(), wesnothd::make_change_diff(), wesnothd::make_delete_diff(), wesnothd::game::notify_new_host(), operator[](), wesnothd::game::process_turn(), wesnothd::server::remove_player(), wesnothd::game::remove_player(), campaignd::server::send_error(), campaignd::server::send_message(), wesnothd::game::send_observerjoins(), wesnothd::game::send_observerquit(), wesnothd::server::send_password_request(), wesnothd::game::send_server_message(), wesnothd::game::send_taken_side(), wesnothd::game::send_user_list(), set_attr(), set_attr_dup(), wesnothd::game::start_game(), wesnothd::game::take_side(), and wesnothd::game::transfer_side_control().
|
inline |
Definition at line 246 of file simple_wml.hpp.
References generate_root(), and root_.
|
inline |
Definition at line 275 of file simple_wml.hpp.
References root(), and simple_wml::node::set_attr().
|
inline |
Definition at line 279 of file simple_wml.hpp.
References root(), and simple_wml::node::set_attr_dup().
Referenced by wesnothd::server::login_client(), and wesnothd::game::save_replay().
|
static |
Definition at line 1197 of file simple_wml.cpp.
Referenced by wesnothd::server::wml_handler().
void simple_wml::document::swap | ( | document & | o | ) |
Definition at line 1142 of file simple_wml.cpp.
References buffers_, compressed_buf_, output_, root_, simple_wml::node::set_doc(), and simple_wml::swap().
Referenced by simple_wml::swap().
|
inline |
Definition at line 283 of file simple_wml.hpp.
References buffers_.
Referenced by simple_wml::node::apply_diff(), and simple_wml::node::set_attr_dup().
|
private |
Definition at line 300 of file simple_wml.hpp.
Referenced by clear(), compress(), document(), dup_string(), generate_root(), output(), output_compressed(), swap(), take_ownership_of_buffer(), and ~document().
|
private |
Definition at line 298 of file simple_wml.hpp.
Referenced by clear(), compress(), generate_root(), output(), output_compressed(), and swap().
|
static |
Definition at line 292 of file simple_wml.hpp.
Referenced by server_base::coro_receive_doc(), and campaignd::server::load_config().
|
private |
Definition at line 307 of file simple_wml.hpp.
Referenced by attach_list(), and detach_list().
|
private |
Definition at line 299 of file simple_wml.hpp.
Referenced by clear(), compress(), document(), generate_root(), output(), and swap().
|
private |
Definition at line 306 of file simple_wml.hpp.
Referenced by attach_list(), and detach_list().
|
private |
Definition at line 301 of file simple_wml.hpp.
Referenced by clear(), compress(), document(), generate_root(), output(), output_compressed(), root(), swap(), and ~document().