#include <simple_wml.hpp>
Public Types | |
typedef std::pair< string_span, string_span > | attribute |
typedef std::vector< node * > | child_list |
Public Member Functions | |
node (document &doc, node *parent) | |
node (document &doc, node *parent, const char **str, int depth=0) | |
~node () | |
const string_span & | operator[] (const char *key) const |
const string_span & | attr (const char *key) const |
bool | has_attr (const char *key) const |
node & | set_attr (const char *key, const char *value) |
node & | set_attr_dup (const char *key, const char *value) |
node & | set_attr_dup (const char *key, const string_span &value) |
node & | set_attr_dup_key_and_value (const char *key, const char *value) |
node & | set_attr_int (const char *key, int value) |
node & | add_child (const char *name) |
node & | add_child_at (const char *name, size_t index) |
void | remove_child (const char *name, size_t index) |
void | remove_child (const string_span &name, size_t index) |
node * | child (const char *name) |
const node * | child (const char *name) const |
const child_list & | children (const char *name) const |
const string_span & | first_child () const |
bool | is_dirty () const |
int | output_size () const |
void | output (char *&buf) |
void | copy_into (node &n) const |
bool | no_children () const |
bool | one_child () const |
void | apply_diff (const node &diff) |
void | set_doc (document *doc) |
int | nchildren () const |
int | nattributes_recursive () const |
Private Types | |
typedef std::vector< attribute > | attribute_list |
typedef std::pair< string_span, child_list > | child_pair |
typedef std::vector< child_pair > | child_map |
Private Member Functions | |
node (const node &) | |
void | operator= (const node &) |
child_list & | get_children (const string_span &name) |
child_list & | get_children (const char *name) |
void | set_dirty () |
void | shift_buffers (ptrdiff_t offset) |
Static Private Member Functions | |
static child_map::const_iterator | find_in_map (const child_map &m, const string_span &attr) |
static child_map::iterator | find_in_map (child_map &m, const string_span &attr) |
Private Attributes | |
document * | doc_ |
attribute_list | attr_ |
node * | parent_ |
child_map | children_ |
string_span | output_cache_ |
Definition at line 90 of file simple_wml.hpp.
typedef std::pair<string_span, string_span> simple_wml::node::attribute |
Definition at line 97 of file simple_wml.hpp.
typedef std::vector<node*> simple_wml::node::child_list |
Definition at line 98 of file simple_wml.hpp.
typedef std::vector<attribute> simple_wml::node::attribute_list [private] |
Definition at line 155 of file simple_wml.hpp.
typedef std::pair<string_span, child_list> simple_wml::node::child_pair [private] |
Definition at line 160 of file simple_wml.hpp.
typedef std::vector<child_pair> simple_wml::node::child_map [private] |
Definition at line 161 of file simple_wml.hpp.
Definition at line 127 of file simple_wml.cpp.
Referenced by add_child(), add_child_at(), and node().
Definition at line 132 of file simple_wml.cpp.
References attr_, boost::foreach_detail_::begin(), boost::foreach_detail_::end(), get_children(), name, node(), output_cache_, and value.
simple_wml::node::~node | ( | ) |
Definition at line 247 of file simple_wml.cpp.
References children_, and simple_wml::debug_delete().
simple_wml::node::node | ( | const node & | ) | [private] |
const string_span & simple_wml::node::operator[] | ( | const char * | key | ) | const |
const string_span& simple_wml::node::attr | ( | const char * | key | ) | const [inline] |
Definition at line 101 of file simple_wml.hpp.
bool simple_wml::node::has_attr | ( | const char * | key | ) | const |
Definition at line 287 of file simple_wml.cpp.
References attr_.
Referenced by server::process_data().
node & simple_wml::node::set_attr | ( | const char * | key, | |
const char * | value | |||
) |
Definition at line 295 of file simple_wml.cpp.
References attr_, and set_dirty().
Referenced by apply_diff(), copy_into(), player::mark_available(), game::notify_new_host(), server::process_data_game(), server::process_whisper(), game::send_change_controller(), game::send_server_message(), simple_wml::document::set_attr(), set_attr_dup(), set_attr_dup_key_and_value(), and game::set_description().
node & simple_wml::node::set_attr_dup | ( | const char * | key, | |
const char * | value | |||
) |
Definition at line 311 of file simple_wml.cpp.
References doc_, simple_wml::document::dup_string(), and set_attr().
Referenced by game::describe_slots(), game::end_turn(), player::mark_available(), player::player(), server::process_data_game(), game::process_message(), game::process_turn(), server::process_whisper(), game::send_server_message(), simple_wml::document::set_attr_dup(), set_attr_int(), and chat_message::truncate_message().
node & simple_wml::node::set_attr_dup | ( | const char * | key, | |
const string_span & | value | |||
) |
Definition at line 316 of file simple_wml.cpp.
References buf, doc_, simple_wml::string_span::duplicate(), set_attr(), and simple_wml::document::take_ownership_of_buffer().
node & simple_wml::node::set_attr_dup_key_and_value | ( | const char * | key, | |
const char * | value | |||
) |
Definition at line 323 of file simple_wml.cpp.
References doc_, simple_wml::document::dup_string(), and set_attr().
node & simple_wml::node::set_attr_int | ( | const char * | key, | |
int | value | |||
) |
Definition at line 328 of file simple_wml.cpp.
References buf, and set_attr_dup().
Referenced by make_add_diff(), make_change_diff(), and make_delete_diff().
node & simple_wml::node::add_child | ( | const char * | name | ) |
Definition at line 349 of file simple_wml.cpp.
References doc_, get_children(), node(), and set_dirty().
Referenced by copy_into(), make_add_diff(), make_change_diff(), make_delete_diff(), server::process_data_game(), game::process_turn(), and game::send_server_message().
node & simple_wml::node::add_child_at | ( | const char * | name, | |
size_t | index | |||
) |
Definition at line 335 of file simple_wml.cpp.
References doc_, get_children(), node(), and set_dirty().
Referenced by apply_diff().
void simple_wml::node::remove_child | ( | const char * | name, | |
size_t | index | |||
) |
Definition at line 381 of file simple_wml.cpp.
Referenced by apply_diff(), server::delete_game(), and game::process_turn().
void simple_wml::node::remove_child | ( | const string_span & | name, | |
size_t | index | |||
) |
Definition at line 358 of file simple_wml.cpp.
References children_, simple_wml::debug_delete(), find_in_map(), and set_dirty().
node * simple_wml::node::child | ( | const char * | name | ) |
Definition at line 386 of file simple_wml.cpp.
References children_.
Referenced by apply_diff(), simple_wml::document::child(), game::is_legal_command(), server::process_data(), server::process_data_game(), and game::start_game().
const node * simple_wml::node::child | ( | const char * | name | ) | const |
const node::child_list & simple_wml::node::children | ( | const char * | name | ) | const |
Definition at line 413 of file simple_wml.cpp.
References children_.
Referenced by apply_diff(), server::delete_game(), make_add_diff(), make_change_diff(), make_delete_diff(), and game::process_turn().
const string_span & simple_wml::node::first_child | ( | ) | const |
bool simple_wml::node::is_dirty | ( | ) | const [inline] |
Definition at line 126 of file simple_wml.hpp.
References simple_wml::string_span::is_null(), and output_cache_.
Referenced by simple_wml::document::output(), and simple_wml::document::output_compressed().
int simple_wml::node::output_size | ( | ) | const |
Definition at line 476 of file simple_wml.cpp.
References attr_, children_, simple_wml::string_span::empty(), output_cache_, and simple_wml::string_span::size().
Referenced by simple_wml::document::output().
void simple_wml::node::output | ( | char *& | buf | ) |
Definition at line 517 of file simple_wml.cpp.
References attr_, boost::foreach_detail_::begin(), simple_wml::string_span::begin(), children_, simple_wml::string_span::empty(), output_cache_, shift_buffers(), and simple_wml::string_span::size().
Referenced by simple_wml::document::output().
void simple_wml::node::copy_into | ( | node & | n | ) | const |
Definition at line 563 of file simple_wml.cpp.
References add_child(), attr_, buf, children_, doc_, set_attr(), set_dirty(), simple_wml::document::take_ownership_of_buffer(), and value.
Referenced by server::process_data_game(), game::process_turn(), and server::process_whisper().
bool simple_wml::node::no_children | ( | ) | const [inline] |
Definition at line 133 of file simple_wml.hpp.
References children_.
Referenced by game::process_turn().
bool simple_wml::node::one_child | ( | ) | const [inline] |
Definition at line 134 of file simple_wml.hpp.
References children_.
Referenced by game::is_legal_command().
void simple_wml::node::apply_diff | ( | const node & | diff | ) |
Definition at line 588 of file simple_wml.cpp.
References add_child_at(), attr_, buf, child(), children(), children_, doc_, simple_wml::string_span::duplicate(), find_in_map(), name, remove_child(), set_attr(), set_dirty(), simple_wml::document::take_ownership_of_buffer(), and value.
void simple_wml::node::set_doc | ( | document * | doc | ) |
Definition at line 656 of file simple_wml.cpp.
References children_, and doc_.
Referenced by simple_wml::document::swap().
int simple_wml::node::nchildren | ( | ) | const |
int simple_wml::node::nattributes_recursive | ( | ) | const |
void simple_wml::node::operator= | ( | const node & | ) | [private] |
node::child_list & simple_wml::node::get_children | ( | const string_span & | name | ) | [private] |
Definition at line 430 of file simple_wml.cpp.
References children_.
Referenced by add_child(), add_child_at(), get_children(), and node().
node::child_list & simple_wml::node::get_children | ( | const char * | name | ) | [private] |
void simple_wml::node::set_dirty | ( | ) | [private] |
Definition at line 692 of file simple_wml.cpp.
Referenced by add_child(), add_child_at(), apply_diff(), copy_into(), remove_child(), and set_attr().
void simple_wml::node::shift_buffers | ( | ptrdiff_t | offset | ) | [private] |
Definition at line 497 of file simple_wml.cpp.
References attr_, simple_wml::string_span::begin(), children_, simple_wml::string_span::empty(), output_cache_, and simple_wml::string_span::size().
Referenced by output().
node::child_map::const_iterator simple_wml::node::find_in_map | ( | const child_map & | m, | |
const string_span & | attr | |||
) | [static, private] |
node::child_map::iterator simple_wml::node::find_in_map | ( | child_map & | m, | |
const string_span & | attr | |||
) | [static, private] |
Definition at line 454 of file simple_wml.cpp.
document* simple_wml::node::doc_ [private] |
Definition at line 153 of file simple_wml.hpp.
Referenced by add_child(), add_child_at(), apply_diff(), copy_into(), set_attr_dup(), set_attr_dup_key_and_value(), and set_doc().
attribute_list simple_wml::node::attr_ [private] |
Definition at line 156 of file simple_wml.hpp.
Referenced by apply_diff(), copy_into(), has_attr(), nattributes_recursive(), node(), operator[](), output(), output_size(), set_attr(), and shift_buffers().
node* simple_wml::node::parent_ [private] |
Definition at line 158 of file simple_wml.hpp.
child_map simple_wml::node::children_ [private] |
Definition at line 165 of file simple_wml.hpp.
Referenced by apply_diff(), child(), children(), copy_into(), first_child(), get_children(), nattributes_recursive(), nchildren(), no_children(), one_child(), output(), output_size(), remove_child(), set_doc(), shift_buffers(), and ~node().
string_span simple_wml::node::output_cache_ [private] |
Definition at line 167 of file simple_wml.hpp.
Referenced by is_dirty(), node(), output(), output_size(), and shift_buffers().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |