51 const char* i1 =
str_;
53 while(i1 != i2 && *o && *i1 == *o) {
58 return i1 == i2 && *o == 0;
77 for(
int n = 0;
n < len; ++
n) {
97 bool to_bool(
bool default_value=
false)
const;
132 bool has_attr(
const char* key)
const;
155 const node*
child(
const char* name)
const;
251 std::unique_ptr<document>
clone();
288 static std::string
stats();
void take_ownership_of_buffer(char *buffer)
const node & root() const
node & set_attr_dup(const char *key, const char *value)
std::unique_ptr< document > clone()
static std::string stats()
const node * child(const char *name) const
document & operator=(const document &)=delete
document(const document &)=delete
static std::size_t document_size_limit
const string_span & operator[](const char *key) const
node * child(const char *name)
const node::child_list & children(const char *name) const
std::vector< char * > buffers_
string_span output_compressed(bool bzip2=false)
const char * dup_string(const char *str)
const string_span & attr(const char *key) const
string_span compressed_buf_
node & set_attr(const char *key, const char *value)
const string_span & attr(const char *key) const
void set_doc(document *doc)
void insert_ordered_child(int child_map_index, int child_list_index)
void insert_ordered_child_list(int child_map_index)
void check_ordered_children() const
void remove_child(const char *name, std::size_t index)
node(const node &)=delete
node(document &doc, node *parent)
int get_children(const string_span &name)
const string_span & operator[](const char *key) const
const child_list & children(const char *name) const
void apply_diff(const node &diff)
bool has_attr(const char *key) const
node & set_attr_int(const char *key, int value)
std::vector< child_pair > child_map
node * child(const char *name)
std::vector< node * > child_list
void remove_ordered_child_list(int child_map_index)
int nattributes_recursive() const
std::vector< node_pos > ordered_children_
std::vector< attribute > attribute_list
const string_span & first_child() const
void output(char *&buf, CACHE_STATUS status=DO_NOT_MODIFY_CACHE)
node & add_child(const char *name)
node & operator=(const node &)=delete
node & set_attr(const char *key, const char *value)
string_span output_cache_
node & add_child_at(const char *name, std::size_t index)
void copy_into(node &n) const
node & set_attr_dup(const char *key, const char *value)
void remove_ordered_child(int child_map_index, int child_list_index)
void shift_buffers(ptrdiff_t offset)
std::pair< string_span, child_list > child_pair
static child_map::const_iterator find_in_map(const child_map &m, const string_span &attr)
bool to_bool(bool default_value=false) const
std::string to_string() const
string_span(const char *begin, const char *end)
bool operator<(const string_span &o) const
bool operator==(const std::string &o) const
const char * begin() const
bool operator!=(const string_span &o) const
string_span(const char *str)
string_span(const char *str, int size)
bool operator==(const char *o) const
const char * const_iterator
bool operator==(const string_span &o) const
bool operator!=(const char *o) const
bool operator!=(const std::string &o) const
void swap(document &lhs, document &rhs)
Implement non-member swap function for std::swap (calls document::swap).
std::ostream & operator<<(std::ostream &o, const string_span &s)
std::string node_to_string(const node &n)
std::size_t index(const std::string &str, const std::size_t index)
Codepoint index corresponding to the nth character in a UTF-8 string.
std::string::const_iterator iterator
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
Base class for all the errors encountered by the engine.
attribute(const string_span &k, const string_span &v)
node_pos(int child_map_index, int child_list_index)
unsigned short child_map_index
unsigned short child_list_index
static map_location::direction n
static map_location::direction s