simple_wml::node Class Reference

#include <simple_wml.hpp>

Collaboration diagram for simple_wml::node:

Collaboration graph
[legend]

List of all members.

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_spanoperator[] (const char *key) const
const string_spanattr (const char *key) const
bool has_attr (const char *key) const
nodeset_attr (const char *key, const char *value)
nodeset_attr_dup (const char *key, const char *value)
nodeset_attr_dup (const char *key, const string_span &value)
nodeset_attr_dup_key_and_value (const char *key, const char *value)
nodeset_attr_int (const char *key, int value)
nodeadd_child (const char *name)
nodeadd_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)
nodechild (const char *name)
const nodechild (const char *name) const
const child_listchildren (const char *name) const
const string_spanfirst_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< attributeattribute_list
typedef std::pair< string_span,
child_list
child_pair
typedef std::vector< child_pairchild_map

Private Member Functions

 node (const node &)
void operator= (const node &)
child_listget_children (const string_span &name)
child_listget_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

documentdoc_
attribute_list attr_
nodeparent_
child_map children_
string_span output_cache_


Detailed Description

Definition at line 90 of file simple_wml.hpp.


Member Typedef Documentation

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.


Constructor & Destructor Documentation

simple_wml::node::node ( document doc,
node parent 
)

Definition at line 127 of file simple_wml.cpp.

Referenced by add_child(), add_child_at(), and node().

simple_wml::node::node ( document doc,
node parent,
const char **  str,
int  depth = 0 
)

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]


Member Function Documentation

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

Definition at line 274 of file simple_wml.cpp.

References attr_.

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 
)

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

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

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  ) 

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  ) 

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

Definition at line 398 of file simple_wml.cpp.

References children_.

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

const string_span & simple_wml::node::first_child (  )  const

Definition at line 466 of file simple_wml.cpp.

References children_.

bool simple_wml::node::is_dirty (  )  const [inline]

int simple_wml::node::output_size (  )  const

void simple_wml::node::output ( char *&  buf  ) 

void simple_wml::node::copy_into ( node n  )  const

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  ) 

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

Definition at line 667 of file simple_wml.cpp.

References children_.

int simple_wml::node::nattributes_recursive (  )  const

Definition at line 680 of file simple_wml.cpp.

References attr_, and children_.

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]

Definition at line 425 of file simple_wml.cpp.

References get_children().

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]

node::child_map::const_iterator simple_wml::node::find_in_map ( const child_map m,
const string_span attr 
) [static, private]

Definition at line 442 of file simple_wml.cpp.

Referenced by apply_diff(), and remove_child().

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.


Member Data Documentation

Definition at line 158 of file simple_wml.hpp.

Definition at line 167 of file simple_wml.hpp.

Referenced by is_dirty(), node(), output(), output_size(), and shift_buffers().


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

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs