#include <simple_wml.hpp>

Classes | |
| struct | node_pos |
Public Types | |
| enum | CACHE_STATUS { REFRESH_CACHE, DO_NOT_MODIFY_CACHE } |
| 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_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, CACHE_STATUS status=DO_NOT_MODIFY_CACHE) |
| 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 &) |
| int | get_children (const string_span &name) |
| int | get_children (const char *name) |
| void | set_dirty () |
| void | shift_buffers (ptrdiff_t offset) |
| void | insert_ordered_child (int child_map_index, int child_list_index) |
| void | remove_ordered_child (int child_map_index, int child_list_index) |
| void | insert_ordered_child_list (int child_map_index) |
| void | remove_ordered_child_list (int child_map_index) |
| void | check_ordered_children () const |
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_ |
| std::vector< node_pos > | ordered_children_ |
| string_span | output_cache_ |
Definition at line 93 of file simple_wml.hpp.
| typedef std::pair<string_span, string_span> simple_wml::node::attribute |
Definition at line 100 of file simple_wml.hpp.
typedef std::vector<attribute> simple_wml::node::attribute_list [private] |
Definition at line 168 of file simple_wml.hpp.
| typedef std::vector<node*> simple_wml::node::child_list |
Definition at line 101 of file simple_wml.hpp.
typedef std::vector<child_pair> simple_wml::node::child_map [private] |
Definition at line 174 of file simple_wml.hpp.
typedef std::pair<string_span, child_list> simple_wml::node::child_pair [private] |
Definition at line 173 of file simple_wml.hpp.
Definition at line 139 of file simple_wml.hpp.
Definition at line 177 of file simple_wml.cpp.
Referenced by add_child(), add_child_at(), and node().

Definition at line 191 of file simple_wml.cpp.
References attr_, check_ordered_children(), children_, ERR_SWML, error(), get_children(), node(), ordered_children_, and output_cache_.

| simple_wml::node::~node | ( | ) |
Definition at line 334 of file simple_wml.cpp.
References children_.
| simple_wml::node::node | ( | const node & | ) | [private] |
| node & simple_wml::node::add_child | ( | const char * | name | ) |
Definition at line 436 of file simple_wml.cpp.
References check_ordered_children(), children_, doc_, get_children(), node(), ordered_children_, and set_dirty().
Referenced by copy_into(), wesnothd::room_manager::fill_member_list(), wesnothd::room_manager::fill_room_list(), server::process_data_game(), wesnothd::game::process_turn(), and wesnothd::game::send_server_message().


| node & simple_wml::node::add_child_at | ( | const char * | name, | |
| size_t | index | |||
| ) |
Definition at line 417 of file simple_wml.cpp.
References check_ordered_children(), children_, doc_, get_children(), insert_ordered_child(), node(), and set_dirty().
Referenced by apply_diff().


| void simple_wml::node::apply_diff | ( | const node & | diff | ) |
Definition at line 798 of file simple_wml.cpp.
References add_child_at(), attr_, child(), children(), children_, doc_, simple_wml::string_span::duplicate(), find_in_map(), remove_child(), set_attr(), set_dirty(), and simple_wml::document::take_ownership_of_buffer().

| const string_span& simple_wml::node::attr | ( | const char * | key | ) | const [inline] |
Definition at line 104 of file simple_wml.hpp.
Referenced by output(), wesnothd::room_manager::process_message(), wesnothd::room_manager::process_room_join(), wesnothd::room_manager::process_room_part(), and wesnothd::room_manager::process_room_query().

| void simple_wml::node::check_ordered_children | ( | ) | const [private] |
Definition at line 543 of file simple_wml.cpp.
References children_, and ordered_children_.
Referenced by add_child(), add_child_at(), node(), and output_size().

| node * simple_wml::node::child | ( | const char * | name | ) |
Definition at line 578 of file simple_wml.cpp.
References children_.
Referenced by apply_diff(), simple_wml::document::child(), wesnothd::game::is_legal_command(), server::process_data(), server::process_data_game(), server::process_nickserv(), wesnothd::room_manager::process_room_query(), and wesnothd::game::start_game().

| const node * simple_wml::node::child | ( | const char * | name | ) | const |
Definition at line 590 of file simple_wml.cpp.
References children_.
| const node::child_list & simple_wml::node::children | ( | const char * | name | ) | const |
Definition at line 605 of file simple_wml.cpp.
References children_.
Referenced by apply_diff(), server::delete_game(), and wesnothd::game::process_turn().

| void simple_wml::node::copy_into | ( | node & | n | ) | const |
Definition at line 777 of file simple_wml.cpp.
References add_child(), attr_, children_, doc_, ordered_children_, set_attr(), set_dirty(), and simple_wml::document::take_ownership_of_buffer().
Referenced by server::process_data_game(), wesnothd::game::process_turn(), and server::process_whisper().


| node::child_map::iterator simple_wml::node::find_in_map | ( | child_map & | m, | |
| const string_span & | attr | |||
| ) | [static, private] |
Definition at line 646 of file simple_wml.cpp.
| node::child_map::const_iterator simple_wml::node::find_in_map | ( | const child_map & | m, | |
| const string_span & | attr | |||
| ) | [static, private] |
Definition at line 634 of file simple_wml.cpp.
Referenced by apply_diff(), and remove_child().

| const string_span & simple_wml::node::first_child | ( | ) | const |
Definition at line 658 of file simple_wml.cpp.
References children_.
| int simple_wml::node::get_children | ( | const string_span & | name | ) | [private] |
Definition at line 622 of file simple_wml.cpp.
References children_.
Referenced by add_child(), add_child_at(), get_children(), and node().

| int simple_wml::node::get_children | ( | const char * | name | ) | [private] |
Definition at line 617 of file simple_wml.cpp.
References get_children().

| bool simple_wml::node::has_attr | ( | const char * | key | ) | const |
Definition at line 374 of file simple_wml.cpp.
References attr_.
Referenced by server::process_data().

| void simple_wml::node::insert_ordered_child | ( | int | child_map_index, | |
| int | child_list_index | |||
| ) | [private] |
Definition at line 475 of file simple_wml.cpp.
References ordered_children_.
Referenced by add_child_at().

| void simple_wml::node::insert_ordered_child_list | ( | int | child_map_index | ) | [private] |
Definition at line 516 of file simple_wml.cpp.
References ordered_children_.
| bool simple_wml::node::is_dirty | ( | ) | const [inline] |
Definition at line 137 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::nattributes_recursive | ( | ) | const |
Definition at line 890 of file simple_wml.cpp.
| int simple_wml::node::nchildren | ( | ) | const |
Definition at line 877 of file simple_wml.cpp.
References children_.
| bool simple_wml::node::no_children | ( | ) | const [inline] |
Definition at line 146 of file simple_wml.hpp.
References children_.
Referenced by wesnothd::game::process_turn().

| bool simple_wml::node::one_child | ( | ) | const [inline] |
Definition at line 147 of file simple_wml.hpp.
References children_.
Referenced by wesnothd::game::is_legal_command().

| void simple_wml::node::operator= | ( | const node & | ) | [private] |
| const string_span & simple_wml::node::operator[] | ( | const char * | key | ) | const |
Definition at line 361 of file simple_wml.cpp.
References attr_.
| void simple_wml::node::output | ( | char *& | buf, | |
| CACHE_STATUS | status = DO_NOT_MODIFY_CACHE | |||
| ) |
Definition at line 714 of file simple_wml.cpp.
References attr(), attr_, simple_wml::string_span::begin(), children_, simple_wml::string_span::empty(), ordered_children_, output_cache_, REFRESH_CACHE, shift_buffers(), and simple_wml::string_span::size().
Referenced by simple_wml::document::output().


| int simple_wml::node::output_size | ( | ) | const |
Definition at line 668 of file simple_wml.cpp.
References attr_, check_ordered_children(), children_, simple_wml::string_span::empty(), ordered_children_, output_cache_, and simple_wml::string_span::size().
Referenced by simple_wml::document::output().


| void simple_wml::node::remove_child | ( | const char * | name, | |
| size_t | index | |||
| ) |
Definition at line 573 of file simple_wml.cpp.
Referenced by apply_diff(), server::delete_game(), wesnothd::game::process_turn(), and wesnothd::room_manager::unstore_player_rooms().

| void simple_wml::node::remove_child | ( | const string_span & | name, | |
| size_t | index | |||
| ) |
Definition at line 449 of file simple_wml.cpp.
References children_, find_in_map(), remove_ordered_child(), remove_ordered_child_list(), and set_dirty().

| void simple_wml::node::remove_ordered_child | ( | int | child_map_index, | |
| int | child_list_index | |||
| ) | [private] |
Definition at line 497 of file simple_wml.cpp.
References ordered_children_.
Referenced by remove_child().

| void simple_wml::node::remove_ordered_child_list | ( | int | child_map_index | ) | [private] |
Definition at line 526 of file simple_wml.cpp.
References ordered_children_.
Referenced by remove_child().

| node & simple_wml::node::set_attr | ( | const char * | key, | |
| const char * | value | |||
| ) |
Definition at line 382 of file simple_wml.cpp.
References attr_, and set_dirty().
Referenced by apply_diff(), wesnothd::game::change_controller(), copy_into(), wesnothd::player::mark_available(), wesnothd::player::mark_registered(), wesnothd::game::notify_new_host(), wesnothd::player::player(), server::process_data_game(), wesnothd::room_manager::process_room_query(), server::process_whisper(), server::send_password_request(), wesnothd::room::send_server_message(), wesnothd::game::send_server_message(), simple_wml::document::set_attr(), set_attr_dup(), wesnothd::game::set_description(), and wesnothd::player::set_status().


| node & simple_wml::node::set_attr_dup | ( | const char * | key, | |
| const char * | value | |||
| ) |
Definition at line 398 of file simple_wml.cpp.
References doc_, simple_wml::document::dup_string(), and set_attr().
Referenced by server::adminmsg_handler(), wesnothd::game::describe_slots(), wesnothd::game::end_turn(), wesnothd::room_manager::fill_member_list(), wesnothd::room_manager::fill_room_list(), wesnothd::player::mark_available(), wesnothd::player::player(), server::pm_handler(), server::process_data_game(), 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(), server::process_whisper(), wesnothd::room::send_server_message(), wesnothd::game::send_server_message(), simple_wml::document::set_attr_dup(), set_attr_int(), and wesnothd::room_manager::unstore_player_rooms().


| node & simple_wml::node::set_attr_dup | ( | const char * | key, | |
| const string_span & | value | |||
| ) |
Definition at line 403 of file simple_wml.cpp.
References doc_, simple_wml::string_span::duplicate(), set_attr(), and simple_wml::document::take_ownership_of_buffer().

| node & simple_wml::node::set_attr_int | ( | const char * | key, | |
| int | value | |||
| ) |
Definition at line 410 of file simple_wml.cpp.
References set_attr_dup().
Referenced by wesnothd::game::process_turn().


| void simple_wml::node::set_dirty | ( | ) | [private] |
Definition at line 902 of file simple_wml.cpp.
References simple_wml::string_span::is_null(), output_cache_, and parent_.
Referenced by add_child(), add_child_at(), apply_diff(), copy_into(), remove_child(), and set_attr().


| void simple_wml::node::set_doc | ( | document * | doc | ) |
Definition at line 866 of file simple_wml.cpp.
References children_, and doc_.
Referenced by simple_wml::document::swap().

| void simple_wml::node::shift_buffers | ( | ptrdiff_t | offset | ) | [private] |
Definition at line 694 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().


attribute_list simple_wml::node::attr_ [private] |
Definition at line 169 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().
child_map simple_wml::node::children_ [private] |
Definition at line 178 of file simple_wml.hpp.
Referenced by add_child(), add_child_at(), apply_diff(), check_ordered_children(), child(), children(), copy_into(), first_child(), get_children(), nattributes_recursive(), nchildren(), no_children(), node(), one_child(), output(), output_size(), remove_child(), set_doc(), shift_buffers(), and ~node().
document* simple_wml::node::doc_ [private] |
Definition at line 166 of file simple_wml.hpp.
Referenced by add_child(), add_child_at(), apply_diff(), copy_into(), set_attr_dup(), and set_doc().
std::vector<node_pos> simple_wml::node::ordered_children_ [private] |
Definition at line 192 of file simple_wml.hpp.
Referenced by add_child(), check_ordered_children(), copy_into(), insert_ordered_child(), insert_ordered_child_list(), node(), output(), output_size(), remove_ordered_child(), and remove_ordered_child_list().
string_span simple_wml::node::output_cache_ [private] |
Definition at line 201 of file simple_wml.hpp.
Referenced by is_dirty(), node(), output(), output_size(), set_dirty(), and shift_buffers().
node* simple_wml::node::parent_ [private] |
Definition at line 171 of file simple_wml.hpp.
Referenced by set_dirty().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:25:54 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |