The Battle for Wesnoth  1.19.7+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 ()
 
std::unique_ptr< 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 &)=delete
 
documentoperator= (const document &)=delete
 
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 236 of file simple_wml.hpp.

Constructor & Destructor Documentation

◆ document() [1/5]

simple_wml::document::document ( )

Definition at line 953 of file simple_wml.cpp.

References attach_list().

◆ document() [2/5]

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

Definition at line 964 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

◆ ~document()

simple_wml::document::~document ( )

Definition at line 1023 of file simple_wml.cpp.

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

◆ document() [5/5]

simple_wml::document::document ( const document )
privatedelete

Member Function Documentation

◆ attach_list()

void simple_wml::document::attach_list ( )
private

Definition at line 1170 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 259 of file simple_wml.hpp.

References root().

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

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

◆ children()

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

Definition at line 271 of file simple_wml.hpp.

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

◆ clear()

void simple_wml::document::clear ( )

Definition at line 1153 of file simple_wml.cpp.

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

◆ clone()

std::unique_ptr< document > simple_wml::document::clone ( )

◆ compress()

void simple_wml::document::compress ( )

◆ detach_list()

void simple_wml::document::detach_list ( )
private

Definition at line 1181 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 1035 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=()

document& simple_wml::document::operator= ( const document )
privatedelete

◆ operator[]()

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

Definition at line 255 of file simple_wml.hpp.

References root().

◆ 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

◆ root() [2/2]

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

Definition at line 246 of file simple_wml.hpp.

References generate_root(), and root_.

◆ set_attr()

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

Definition at line 275 of file simple_wml.hpp.

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

◆ set_attr_dup()

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

◆ stats()

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

Definition at line 1197 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

Definition at line 283 of file simple_wml.hpp.

References buffers_.

Referenced by simple_wml::node::apply_diff(), and simple_wml::node::set_attr_dup().

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

Referenced by attach_list(), and detach_list().

◆ output_

const char* simple_wml::document::output_
private

Definition at line 299 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 306 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: