NCBI C++ ToolKit
|
Search Toolkit Book for xml::attributes::attr
The xml::attributes::attr class is used to hold information about one attribute. More...
#include <misc/xmlwrapp/attributes.hpp>
Public Member Functions | |
bool | is_default (void) const |
Test if the attribute is default. More... | |
const char * | get_name (void) const |
Get the name of this attribute. More... | |
const char * | get_value (void) const |
Get the value of this attribute. More... | |
void | set_value (const char *value) |
Set the value of this attribute. More... | |
ns | get_namespace (ns::ns_safety_type type=ns::type_safe_ns) const |
Get the attribute's namespace. More... | |
void | erase_namespace (void) |
Unset the attribute's namespace. More... | |
ns | set_namespace (const char *prefix) |
Set the attribute's namespace. More... | |
ns | set_namespace (const ns &name_space) |
Set the attribute's namespace. More... | |
Private Member Functions | |
attr (void) | |
attr (const attr &other) | |
attr & | operator= (const attr &other) |
void | swap (attr &other) |
void | set_data (void *node, void *prop, bool def_prop) |
void * | normalize (void) const |
void * | get_node (void) const |
bool | operator== (const attr &other) const |
void | convert (void) |
void * | resolve_default_attr_ns (void) const |
Private Attributes | |
void * | xmlnode_ |
void * | prop_ |
void * | phantom_prop_ |
std::string | value_ |
Friends | |
class | impl::ait_impl |
class | iterator |
class | const_iterator |
class | attributes |
struct | xml::impl::attr_instance |
bool | impl::operator== (const impl::ait_impl &lhs, const impl::ait_impl &rhs) |
void * | xml::impl::get_ptr_to_attr_instance (void *) |
The xml::attributes::attr class is used to hold information about one attribute.
Definition at line 151 of file attributes.hpp.
|
private |
Definition at line 273 of file ait_impl.cpp.
Definition at line 276 of file ait_impl.cpp.
|
private |
Definition at line 422 of file ait_impl.cpp.
References kInvalidDefaultIterError, and NULL.
void xml::attributes::attr::erase_namespace | ( | void | ) |
Unset the attribute's namespace.
Definition at line 453 of file ait_impl.cpp.
const char * xml::attributes::attr::get_name | ( | void | ) | const |
Get the name of this attribute.
Definition at line 335 of file ait_impl.cpp.
References kInvalidDefaultIterError.
Referenced by AddStructuredCommentToAttributes(), GetBioSampleStatusFromNode(), and ProcessBiosampleStatusNode().
xml::ns xml::attributes::attr::get_namespace | ( | ns::ns_safety_type | type = ns::type_safe_ns | ) | const |
Get the attribute's namespace.
type | The required type of namespace object (safe/unsafe). |
Definition at line 380 of file ait_impl.cpp.
References xml::attributes::createUnsafeNamespace(), xml::ns::type_safe_ns, and xml::ns::type_void.
|
private |
Definition at line 320 of file ait_impl.cpp.
Referenced by xml::impl::get_ptr_to_attr_instance().
const char * xml::attributes::attr::get_value | ( | void | ) | const |
Get the value of this attribute.
Definition at line 350 of file ait_impl.cpp.
References kInvalidDefaultIterError.
Referenced by AddStructuredCommentToAttributes(), GetBioSampleStatusFromNode(), CEntrezDB::GetUidAttr(), and ProcessBiosampleStatusNode().
bool xml::attributes::attr::is_default | ( | void | ) | const |
Test if the attribute is default.
Definition at line 329 of file ait_impl.cpp.
Referenced by xml::attributes::erase().
|
private |
Definition at line 307 of file ait_impl.cpp.
References xml::impl::phantom_attr::def_prop_, and NULL.
Referenced by xml::attributes::iterator::operator*(), xml::attributes::const_iterator::operator*(), xml::attributes::iterator::operator->(), xml::attributes::const_iterator::operator->(), and xml::impl::operator==().
|
private |
Definition at line 281 of file ait_impl.cpp.
References xml::attributes::swap(), and tmp.
Definition at line 324 of file ait_impl.cpp.
|
private |
Definition at line 405 of file ait_impl.cpp.
References kInvalidDefaultIterError, and NULL.
|
private |
Definition at line 294 of file ait_impl.cpp.
References xml::attributes::node.
Referenced by xml::impl::ait_impl::ait_impl().
Set the attribute's namespace.
The namespace definition is searched up in the hierarchy of nodes. If a namespace with the given prefix is not found then throw an exception.
prefix | Namespace prefix. You can use empty string or NULL to remove the namespace – it works exactly the same as erase_namespace() call. |
Definition at line 459 of file ait_impl.cpp.
References convert(), xml::attributes::createUnsafeNamespace(), and NULL.
Set the attribute's namespace.
The namespace definition is searched up in the hierarchy of nodes. If a namespace with the given prefix and URI is not found then throw an exception.
name_space | Namespace object. You can use "void" or default namespace to remove the namespace – it works exactly the same as erase_namespace() call. |
Definition at line 475 of file ait_impl.cpp.
References convert(), xml::attributes::createUnsafeNamespace(), xml::ns::get_prefix(), xml::ns::get_uri(), xml::attributes::getUnsafeNamespacePointer(), xml::ns::is_safe(), xml::ns::is_void(), and NULL.
void xml::attributes::attr::set_value | ( | const char * | value | ) |
Set the value of this attribute.
value | The value for this attribute. |
Definition at line 443 of file ait_impl.cpp.
References convert(), and rapidjson::value.
|
private |
Definition at line 287 of file ait_impl.cpp.
References phantom_prop_, prop_, swap(), value_, and xmlnode_.
Referenced by xml::impl::ait_impl::operator=().
|
friend |
Definition at line 277 of file attributes.hpp.
|
friend |
Definition at line 276 of file attributes.hpp.
|
friend |
Definition at line 274 of file attributes.hpp.
|
friend |
|
friend |
Definition at line 275 of file attributes.hpp.
|
friend |
Definition at line 278 of file attributes.hpp.
|
friend |
|
private |
Definition at line 258 of file attributes.hpp.
Referenced by swap().
|
private |
Definition at line 257 of file attributes.hpp.
Referenced by xml::attributes::erase(), xml::impl::ait_impl::operator++(), and swap().
|
mutableprivate |
Definition at line 259 of file attributes.hpp.
Referenced by swap().
|
private |
Definition at line 256 of file attributes.hpp.
Referenced by xml::attributes::erase(), xml::impl::operator==(), and swap().