39#ifndef _xmlwrapp_attributes_h_
40#define _xmlwrapp_attributes_h_
44#include "xmlwrapp/export.h"
52XMLWRAPP_MSVC_SUPPRESS_DLL_MEMBER_WARN
134 void *node_{
nullptr};
135 void *prop_{
nullptr};
138 mutable std::string value_;
141 attr(
const attr& other) =
default;
142 attr& operator=(
const attr& other) =
default;
143 void swap(attr& other);
145 void set_data(
void *
node,
void *prop);
146 void set_data(
const char *name,
const char *value,
bool);
148 friend class impl::ait_impl;
158 using difference_type = std::ptrdiff_t;
161 using iterator_category = std::forward_iterator_tag;
177 friend bool XMLWRAPP_API operator==(
const iterator& lhs,
const iterator& rhs);
178 friend bool XMLWRAPP_API operator!=(
const iterator& lhs,
const iterator& rhs);
181 std::unique_ptr<impl::ait_impl> pimpl_;
184 iterator(
const char *name,
const char *value,
bool);
186 void* get_raw_attr();
199 using difference_type = std::ptrdiff_t;
202 using iterator_category = std::forward_iterator_tag;
223 std::unique_ptr<impl::ait_impl> pimpl_;
228 void* get_raw_attr();
274 void insert(
const char *name,
const char *value);
341 std::unique_ptr<pimpl> pimpl_;
346 void set_data (
void *
node);
348 friend struct impl::node_impl;
354XMLWRAPP_MSVC_RESTORE_DLL_MEMBER_WARN
The xml::attributes::attr class is used to hold information about one attribute.
Definition attributes.h:117
const char * get_name() const
Get the name of this attribute.
const char * get_value() const
Get the value of this attribute.
Const Iterator class for accessing attribute pairs.
Definition attributes.h:196
const_iterator & operator++()
prefix increment
Iterator class for accessing attribute pairs.
Definition attributes.h:155
iterator operator++(int)
postfix increment (avoid if possible for better performance)
iterator & operator++()
prefix increment
The xml::attributes class is used to access all the attributes of one xml::node.
Definition attributes.h:75
size_type size() const
Find out how many attributes there are in this xml::attributes object.
iterator begin()
Get an iterator that points to the first attribute.
attributes(const attributes &other)
Copy construct a xml::attributes object.
void swap(attributes &other)
Swap this xml::attributes object with another one.
iterator erase(iterator to_erase)
Erase the attribute that is pointed to by the given iterator.
const_iterator find(const char *name) const
Find the attribute with the given name.
const_iterator begin() const
Get a const_iterator that points to the first attribute.
iterator find(const char *name)
Find the attribute with the given name.
void erase(const char *name)
Erase the attribute with the given name.
iterator end()
Get an iterator that points one past the the last attribute.
attributes & operator=(const attributes &other)
Copy the given xml::attributes object into this one.
const_iterator end() const
Get a const_iterator that points one past the last attribute.
attributes()
Create a new xml::attributes object with no attributes.
bool empty() const
Find out if there are any attributes in this xml::attributes object.
std::size_t size_type
size type
Definition attributes.h:78
void insert(const char *name, const char *value)
Add an attribute to the attributes list.
The xml::node class is used to hold information about one XML node.
Definition node.h:92
XML library namespace.
Definition attributes.h:55
This file contains the definition of the xml::init class.