The Battle for Wesnoth  1.15.1+dev
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
simple_wml::document Class Reference

#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)
 
noderoot ()
 
const noderoot () const
 
const char * output ()
 
string_span output_compressed (bool bzip2=false)
 
void compress ()
 
documentclone ()
 
const string_spanoperator[] (const char *key) const
 
const string_spanattr (const char *key) const
 
nodechild (const char *name)
 
const nodechild (const char *name) const
 
const node::child_listchildren (const char *name) const
 
nodeset_attr (const char *key, const char *value)
 
nodeset_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 &)
 
void operator= (const document &)
 
void attach_list ()
 
void detach_list ()
 

Private Attributes

string_span compressed_buf_
 
const char * output_
 
std::vector< char * > buffers_
 
noderoot_
 
documentprev_
 
documentnext_
 

Detailed Description

Definition at line 233 of file simple_wml.hpp.

Constructor & Destructor Documentation

◆ document() [1/5]

simple_wml::document::document ( )

Definition at line 937 of file simple_wml.cpp.

References attach_list().

Referenced by clone().

◆ document() [2/5]

simple_wml::document::document ( char *  buf,
INIT_BUFFER_CONTROL  control = INIT_TAKE_OWNERSHIP 
)
explicit

Definition at line 948 of file simple_wml.cpp.

References attach_list(), buffers_, simple_wml::INIT_TAKE_OWNERSHIP, and root_.

◆ document() [3/5]

simple_wml::document::document ( const char *  buf,
INIT_STATE  state 
)

◆ document() [4/5]

simple_wml::document::document ( string_span  compressed_buf)
explicit

Definition at line 983 of file simple_wml.cpp.

References attach_list(), simple_wml::string_span::begin(), buffers_, output_, and root_.

◆ ~document()

simple_wml::document::~document ( )

Definition at line 1006 of file simple_wml.cpp.

References buffers_, detach_list(), i, and root_.

◆ document() [5/5]

simple_wml::document::document ( const document )
private

Member Function Documentation

◆ attach_list()

void simple_wml::document::attach_list ( )
private

Definition at line 1153 of file simple_wml.cpp.

References next_, and prev_.

Referenced by document().

◆ attr()

const string_span& simple_wml::document::attr ( const char *  key) const
inline

Definition at line 256 of file simple_wml.hpp.

◆ child() [1/2]

node* simple_wml::document::child ( const char *  name)
inline

◆ child() [2/2]

const node* simple_wml::document::child ( const char *  name) const
inline

Definition at line 264 of file simple_wml.hpp.

References simple_wml::node::child().

◆ children()

const node::child_list& simple_wml::document::children ( const char *  name) const
inline

Definition at line 268 of file simple_wml.hpp.

Referenced by wesnothd::server::handle_player_in_game().

◆ clear()

void simple_wml::document::clear ( )

Definition at line 1136 of file simple_wml.cpp.

References buffers_, compressed_buf_, i, output_, and root_.

Referenced by wesnothd::server::handle_player_in_game().

◆ clone()

document * simple_wml::document::clone ( )

◆ compress()

void simple_wml::document::compress ( )

◆ detach_list()

void simple_wml::document::detach_list ( )
private

Definition at line 1164 of file simple_wml.cpp.

References next_, and prev_.

Referenced by ~document().

◆ dup_string()

const char * simple_wml::document::dup_string ( const char *  str)

Definition at line 1018 of file simple_wml.cpp.

References buffers_.

Referenced by simple_wml::node::set_attr_dup().

◆ generate_root()

void simple_wml::document::generate_root ( )
private

◆ operator=()

void simple_wml::document::operator= ( const document )
private

◆ operator[]()

const string_span& simple_wml::document::operator[] ( const char *  key) const
inline

Definition at line 252 of file simple_wml.hpp.

◆ output()

const char * simple_wml::document::output ( )

◆ output_compressed()

string_span simple_wml::document::output_compressed ( bool  bzip2 = false)

◆ root() [1/2]

node& simple_wml::document::root ( )
inline

Definition at line 242 of file simple_wml.hpp.

Referenced by wesnothd::server::add_player(), wesnothd::game::add_player(), wesnothd::server::adminmsg_handler(), wesnothd::game::allow_observers(), async_send_error(), async_send_message(), async_send_warning(), wesnothd::game::change_controller(), wesnothd::server::create_game(), wesnothd::server::delete_game(), wesnothd::game::get_replay_filename(), wesnothd::game::get_sides_list(), wesnothd::game::handle_controller_choice(), wesnothd::server::handle_join_game(), wesnothd::server::handle_message(), wesnothd::server::handle_player_in_game(), wesnothd::game::handle_random_choice(), wesnothd::server::handle_whisper(), wesnothd::server::is_login_allowed(), wesnothd::game::is_reload(), wesnothd::game::load_next_scenario(), wesnothd::make_add_diff(), wesnothd::make_change_diff(), wesnothd::make_delete_diff(), wesnothd::game::notify_new_host(), wesnothd::server::pm_handler(), wesnothd::game::process_message(), wesnothd::game::process_turn(), wesnothd::server::read_version(), wesnothd::game::registered_users_only(), 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::send_server_message(), wesnothd::game::send_taken_side(), wesnothd::game::send_user_list(), wesnothd::game::start_game(), simple_wml::swap(), wesnothd::game::take_side(), and wesnothd::game::transfer_side_control().

◆ root() [2/2]

const node& simple_wml::document::root ( ) const
inline

Definition at line 243 of file simple_wml.hpp.

References output().

◆ set_attr()

node& simple_wml::document::set_attr ( const char *  key,
const char *  value 
)
inline

Definition at line 272 of file simple_wml.hpp.

References simple_wml::node::set_attr().

Referenced by wesnothd::server::read_version().

◆ set_attr_dup()

node& simple_wml::document::set_attr_dup ( const char *  key,
const char *  value 
)
inline

Definition at line 276 of file simple_wml.hpp.

References simple_wml::node::set_attr_dup().

Referenced by wesnothd::game::save_replay().

◆ stats()

std::string simple_wml::document::stats ( )
static

Definition at line 1180 of file simple_wml.cpp.

References d, and s.

Referenced by wesnothd::server::wml_handler().

◆ swap()

void simple_wml::document::swap ( document o)

◆ take_ownership_of_buffer()

void simple_wml::document::take_ownership_of_buffer ( char *  buffer)
inline

Member Data Documentation

◆ buffers_

std::vector<char*> simple_wml::document::buffers_
private

◆ compressed_buf_

string_span simple_wml::document::compressed_buf_
private

Definition at line 295 of file simple_wml.hpp.

Referenced by clear(), compress(), generate_root(), output(), output_compressed(), and swap().

◆ document_size_limit

std::size_t simple_wml::document::document_size_limit = 40000000
static

◆ next_

document* simple_wml::document::next_
private

Definition at line 304 of file simple_wml.hpp.

Referenced by attach_list(), and detach_list().

◆ output_

const char* simple_wml::document::output_
private

Definition at line 296 of file simple_wml.hpp.

Referenced by clear(), compress(), document(), generate_root(), output(), and swap().

◆ prev_

document* simple_wml::document::prev_
private

Definition at line 303 of file simple_wml.hpp.

Referenced by attach_list(), and detach_list().

◆ root_

node* simple_wml::document::root_
private

The documentation for this class was generated from the following files: