The Battle for Wesnoth  1.19.0-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 234 of file simple_wml.hpp.

Constructor & Destructor Documentation

◆ document() [1/5]

simple_wml::document::document ( )

Definition at line 939 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 950 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 1009 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 1156 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 257 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 265 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 269 of file simple_wml.hpp.

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

◆ clear()

void simple_wml::document::clear ( )

Definition at line 1139 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 1167 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 1021 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 253 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 244 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 273 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 1183 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 281 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 296 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 305 of file simple_wml.hpp.

Referenced by attach_list(), and detach_list().

◆ output_

const char* simple_wml::document::output_
private

Definition at line 297 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 304 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: