The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | 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 ()
 

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 230 of file simple_wml.hpp.

Constructor & Destructor Documentation

simple_wml::document::document ( )

Definition at line 938 of file simple_wml.cpp.

References attach_list().

Referenced by clone().

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

Definition at line 949 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 
)
simple_wml::document::document ( string_span  compressed_buf)
explicit

Definition at line 984 of file simple_wml.cpp.

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

simple_wml::document::~document ( )

Definition at line 1007 of file simple_wml.cpp.

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

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

Member Function Documentation

void simple_wml::document::attach_list ( )
private

Definition at line 1154 of file simple_wml.cpp.

References next_, and prev_.

Referenced by document().

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

Definition at line 253 of file simple_wml.hpp.

References root().

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

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

Definition at line 261 of file simple_wml.hpp.

References simple_wml::node::child(), and root().

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

Definition at line 265 of file simple_wml.hpp.

References simple_wml::node::children(), and root().

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

void simple_wml::document::clear ( )

Definition at line 1137 of file simple_wml.cpp.

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

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

document * simple_wml::document::clone ( )
void simple_wml::document::compress ( )
void simple_wml::document::detach_list ( )
private

Definition at line 1165 of file simple_wml.cpp.

References next_, and prev_.

Referenced by ~document().

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

Definition at line 1019 of file simple_wml.cpp.

References buffers_.

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

void simple_wml::document::generate_root ( )
private

Definition at line 1105 of file simple_wml.cpp.

References buffers_, compressed_buf_, simple_wml::string_span::empty(), output_, and root_.

Referenced by root().

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

Definition at line 249 of file simple_wml.hpp.

References root().

const char * simple_wml::document::output ( )
string_span simple_wml::document::output_compressed ( bool  bzip2 = false)
node& simple_wml::document::root ( )
inline

Definition at line 239 of file simple_wml.hpp.

References generate_root(), and root_.

Referenced by wesnothd::server::add_player(), wesnothd::game::add_player(), wesnothd::server::adminmsg_handler(), wesnothd::game::allow_observers(), wesnothd::async_send_error(), wesnothd::async_send_warning(), attr(), wesnothd::game::change_controller(), child(), children(), wesnothd::server::create_game(), wesnothd::server::delete_game(), wesnothd::game::get_sides_list(), wesnothd::game::handle_controller_choice(), wesnothd::server::handle_create_game(), wesnothd::server::handle_join_game(), wesnothd::server::handle_login(), wesnothd::server::handle_message(), wesnothd::server::handle_nickserv(), wesnothd::server::handle_player_in_game(), wesnothd::game::handle_random_choice(), wesnothd::server::handle_whisper(), wesnothd::game::load_next_scenario(), wesnothd::make_add_diff(), wesnothd::make_change_diff(), wesnothd::make_delete_diff(), wesnothd::game::notify_new_host(), operator[](), wesnothd::server::pm_handler(), wesnothd::room_manager::process_message(), wesnothd::game::process_message(), wesnothd::room_manager::process_room_join(), wesnothd::room_manager::process_room_part(), wesnothd::room_manager::process_room_query(), wesnothd::game::process_turn(), wesnothd::server::read_version(), wesnothd::game::registered_users_only(), wesnothd::server::remove_player(), wesnothd::game::remove_player(), wesnothd::game::save_replay(), wesnothd::game::send_observerjoins(), wesnothd::game::send_observerquit(), wesnothd::send_server_message(), wesnothd::room::send_server_message(), 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(), wesnothd::game::transfer_side_control(), and wesnothd::room_manager::unstore_player_rooms().

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

Definition at line 240 of file simple_wml.hpp.

References generate_root(), and root_.

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

Definition at line 269 of file simple_wml.hpp.

References root(), and simple_wml::node::set_attr().

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

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

Definition at line 273 of file simple_wml.hpp.

References root(), and simple_wml::node::set_attr_dup().

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

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

Definition at line 1181 of file simple_wml.cpp.

References d.

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

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

Member Data Documentation

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

Definition at line 291 of file simple_wml.hpp.

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

document* simple_wml::document::next_
private

Definition at line 300 of file simple_wml.hpp.

Referenced by attach_list(), and detach_list().

const char* simple_wml::document::output_
private

Definition at line 292 of file simple_wml.hpp.

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

document* simple_wml::document::prev_
private

Definition at line 299 of file simple_wml.hpp.

Referenced by attach_list(), and detach_list().

node* simple_wml::document::root_
private

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