NCBI C++ ToolKit
ait_impl.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /*
2  * Copyright (C) 2001-2003 Peter J Jones (pjones@pmade.org)
3  * All Rights Reserved
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in
13  * the documentation and/or other materials provided with the
14  * distribution.
15  * 3. Neither the name of the Author nor the names of its contributors
16  * may be used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
23  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
29  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30  * SUCH DAMAGE.
31  */
32 
33 /*
34  * $Id: ait_impl.cpp 101294 2023-11-28 14:10:36Z satskyse $
35  * NOTE: This file was modified from its original version 0.6.0
36  * to fit the NCBI C++ Toolkit build framework and
37  * API and functionality requirements.
38  * Most importantly, it adds support for XML namespaces (see "namespace.hpp").
39  */
40 
41 /** @file
42  * This file implements the ait_impl, xml::attributes::iterator,
43  * xml::attributes::const_iterator and xml::attributes::attr classes.
44 **/
45 
46 // xmlwrapp includes
47 #include "ait_impl.hpp"
48 #include "deref_impl.hpp"
49 #include "utility.hpp"
52 
53 // standard includes
54 #include <algorithm>
55 #include <stdexcept>
56 #include <string.h>
57 
58 // libxml2 includes
59 #include <libxml/tree.h>
60 #include <libxml/valid.h>
61 
62 using namespace xml;
63 using namespace xml::impl;
64 
65 
66 const char* kDerefError = "dereferencing non initialised or out of range iterator";
67 const char* kRefError = "referencing non initialised or out of range iterator";
68 const char* kAdvError = "advancing non initialised or out of range iterator";
69 const char* kInvalidDefaultIterError = "invalid default attribute iterator";
70 
71 
72 /*
73  * First we have the ait_impl class.
74  */
75 
76 //####################################################################
77 ait_impl::ait_impl (xmlNodePtr node, xmlAttrPtr prop, bool from_find) :
78  from_find_(from_find) {
79  attr_.set_data(node, prop, false);
80 }
81 //####################################################################
82 ait_impl::ait_impl (xmlNodePtr node, phantom_attr* prop, bool from_find) :
83  from_find_(from_find) {
84  attr_.set_data(node, prop, true);
85 }
86 //####################################################################
87 ait_impl::ait_impl (const ait_impl &other) :
88  attr_(other.attr_),
89  from_find_(other.from_find_)
90 {}
91 //####################################################################
93  ait_impl tmp(other);
94 
95  attr_.swap(tmp.attr_);
96  std::swap(from_find_, tmp.from_find_);
97  return *this;
98 }
99 //####################################################################
101  return &attr_;
102 }
103 //####################################################################
105  if (from_find_)
106  throw xml::exception("cannot iterate using iterators "
107  "produced by find(...) methods");
108 
109  // Here: the iterator cannot point to a default attribute because
110  // it is not produced by find(...) methods
111  if (attr_.prop_)
112  attr_.prop_ = static_cast<xmlAttrPtr>(attr_.prop_)->next;
113  else
114  throw xml::exception(kAdvError);
115  return *this;
116 }
117 //####################################################################
119  ait_impl tmp(*this);
120  ++(*this);
121  return tmp;
122 }
123 //####################################################################
124 
125 /*
126  * Member functions for the xml::attributes::iterator class.
127  */
128 
129 //####################################################################
131  pimpl_ = new ait_impl(0, static_cast<xmlAttrPtr>(0), false);
132 }
133 //####################################################################
135  bool def_prop, bool from_find) {
136  if (def_prop)
137  pimpl_ = new ait_impl(static_cast<xmlNodePtr>(node),
138  static_cast<phantom_attr*>(prop), from_find);
139  else
140  pimpl_ = new ait_impl(static_cast<xmlNodePtr>(node),
141  static_cast<xmlAttrPtr>(prop), from_find);
142 }
143 //####################################################################
145  pimpl_ = new ait_impl(*other.pimpl_);
146 }
147 //####################################################################
150  iterator tmp(other);
151  swap(tmp);
152  return *this;
153 }
154 //####################################################################
156  std::swap(pimpl_, other.pimpl_);
157 }
158 //####################################################################
160  delete pimpl_;
161 }
162 //####################################################################
165  xml::attributes::attr* att = pimpl_->get();
166  if (att->normalize())
167  return * static_cast<xml::attributes::attr*>
170 }
171 //####################################################################
174  xml::attributes::attr* att = pimpl_->get();
175  if (att->normalize())
176  return static_cast<xml::attributes::attr*>
178  throw xml::exception(kRefError);
179 }
180 //####################################################################
182  ++(*pimpl_);
183  return *this;
184 }
185 //####################################################################
187  iterator tmp(*this);
188  ++(*this);
189  return tmp;
190 }
191 //####################################################################
192 
193 /*
194  * Member functions for the xml::attributes::const_iterator class.
195  */
196 
197 //####################################################################
199  pimpl_ = new ait_impl(0, static_cast<xmlAttrPtr>(0), false);
200 }
201 //####################################################################
203  bool def_prop,
204  bool from_find) {
205  if (def_prop)
206  pimpl_ = new ait_impl(static_cast<xmlNodePtr>(node),
207  static_cast<phantom_attr*>(prop), from_find);
208  else
209  pimpl_ = new ait_impl(static_cast<xmlNodePtr>(node),
210  static_cast<xmlAttrPtr>(prop), from_find);
211 }
212 //####################################################################
214  pimpl_ = new ait_impl(*other.pimpl_);
215 }
216 //####################################################################
218  pimpl_ = new ait_impl(*other.pimpl_);
219 }
220 //####################################################################
223  const_iterator tmp(other);
224  swap(tmp);
225  return *this;
226 }
227 //####################################################################
229  std::swap(pimpl_, other.pimpl_);
230 }
231 //####################################################################
233  delete pimpl_;
234 }
235 //####################################################################
238  xml::attributes::attr* att = pimpl_->get();
239  if (att->normalize())
240  return * static_cast<xml::attributes::attr*>
243 }
244 //####################################################################
247  xml::attributes::attr* att = pimpl_->get();
248  if (att->normalize())
249  return static_cast<xml::attributes::attr*>
251  throw xml::exception(kRefError);
252 }
253 //####################################################################
256  ++(*pimpl_);
257  return *this;
258 }
259 //####################################################################
262  const_iterator tmp(*this);
263  ++(*this);
264  return tmp;
265 }
266 //####################################################################
267 
268 /*
269  * Member functions for the xml::attributes::attr class.
270  */
271 
272 //####################################################################
273 xml::attributes::attr::attr (void) : xmlnode_(0), prop_(0), phantom_prop_(0)
274 {}
275 //####################################################################
277  xmlnode_(other.xmlnode_), prop_(other.prop_),
278  phantom_prop_(other.phantom_prop_), value_(other.value_)
279 {}
280 //####################################################################
282  attr tmp(other);
283  swap(tmp);
284  return *this;
285 }
286 //####################################################################
288  std::swap(xmlnode_, other.xmlnode_);
289  std::swap(prop_, other.prop_);
290  std::swap(phantom_prop_, other.phantom_prop_);
291  value_.swap(other.value_);
292 }
293 //####################################################################
294 void xml::attributes::attr::set_data (void *node, void *prop, bool def_prop) {
295  xmlnode_ = node;
296  value_.erase();
297  if (def_prop) {
298  prop_ = 0;
299  phantom_prop_ = prop;
300  }
301  else {
302  prop_ = prop;
303  phantom_prop_ = 0;
304  }
305 }
306 //####################################################################
307 void * xml::attributes::attr::normalize (void) const {
308  if (!xmlnode_) return NULL;
309  if (prop_) return prop_;
310 
311  if (phantom_prop_) {
312  if (static_cast<phantom_attr*>(phantom_prop_)->prop_)
313  return static_cast<phantom_attr*>(phantom_prop_)->prop_;
314  if (static_cast<phantom_attr*>(phantom_prop_)->def_prop_)
315  return static_cast<phantom_attr*>(phantom_prop_)->def_prop_;
316  }
317  return NULL;
318 }
319 //####################################################################
321  return xmlnode_;
322 }
323 //####################################################################
324 bool xml::attributes::attr::operator==
325 (const xml::attributes::attr & other) const {
326  return normalize() == other.normalize();
327 }
328 //####################################################################
330  if (phantom_prop_ && (!static_cast<phantom_attr*>(phantom_prop_)->prop_))
331  return true;
332  return false;
333 }
334 //####################################################################
335 const char* xml::attributes::attr::get_name (void) const {
336  if (is_default()) {
337  xmlAttributePtr dprop = static_cast<phantom_attr*>(phantom_prop_)->def_prop_;
338  if (!dprop)
340  return reinterpret_cast<const char*>(dprop->name);
341  }
342  if (prop_) {
343  const xmlChar * name = static_cast<xmlAttrPtr>(prop_)->name;
344  return reinterpret_cast<const char*>(name);
345  }
346  const xmlChar * name = static_cast<phantom_attr*>(phantom_prop_)->prop_->name;
347  return reinterpret_cast<const char*>(name);
348 }
349 //####################################################################
350 const char* xml::attributes::attr::get_value (void) const {
351  if (is_default()) {
352  xmlAttributePtr dprop = static_cast<phantom_attr*>(phantom_prop_)->def_prop_;
353  if (!dprop)
355  if (dprop->defaultValue)
356  return reinterpret_cast<const char*>(dprop->defaultValue);
357  return "";
358  }
359 
360  xmlChar *tmpstr;
361  if (prop_) {
362  tmpstr = xmlNodeListGetString(reinterpret_cast<xmlNodePtr>(xmlnode_)->doc,
363  reinterpret_cast<xmlAttrPtr>(prop_)->children,
364  1);
365  }
366  else {
367  tmpstr = xmlNodeListGetString(reinterpret_cast<xmlNodePtr>(xmlnode_)->doc,
368  reinterpret_cast<phantom_attr*>(phantom_prop_)->prop_->children,
369  1);
370  }
371  if (tmpstr == 0)
372  return "";
373 
374  xmlchar_helper helper(tmpstr);
375  value_.assign(reinterpret_cast<const char*>(tmpstr));
376  return value_.c_str();
377 }
378 //####################################################################
379 xml::ns
381  xmlNs * definition;
382  if (is_default()) {
383  definition = static_cast<xmlNs*>(resolve_default_attr_ns());
384  }
385  else {
386  xmlAttrPtr prop = reinterpret_cast<xmlAttrPtr>(prop_);
387  if (!prop_)
388  prop = reinterpret_cast<phantom_attr*>(phantom_prop_)->prop_;
389  definition = prop->ns;
390  }
391 
392  if (type == xml::ns::type_safe_ns) {
393  return definition
394  ? xml::ns(reinterpret_cast<const char*>(definition->prefix),
395  reinterpret_cast<const char*>(definition->href))
397  }
398  // unsafe namespace
399  return xml::attributes::createUnsafeNamespace(definition);
400 }
401 //####################################################################
402 // Resolves a namespace for a default attribute.
403 // If it cannot resolve it then an exception is thrown.
404 // NULL is returned if no namespace should be used.
406  if (!is_default())
407  throw xml::exception("internal library error: "
408  "resolving non-default attribute namespace");
409 
410  xmlAttributePtr dprop = static_cast<phantom_attr*>(phantom_prop_)->def_prop_;
411  if (!dprop)
413  xmlNs * definition(xmlSearchNs(NULL, reinterpret_cast<xmlNode*>(xmlnode_),
414  dprop->prefix));
415  if (dprop->prefix)
416  if (!definition)
417  throw xml::exception("cannot resolve default attribute namespace");
418  return definition;
419 }
420 //####################################################################
421 // This converts a default attribute to a regular one
423  if (!is_default())
424  return;
425 
426  xmlNs * definition = static_cast<xmlNs*>(resolve_default_attr_ns());
427  xmlAttributePtr dprop = static_cast<phantom_attr*>(phantom_prop_)->def_prop_;
428  if (!dprop)
430  xmlAttrPtr new_attr = xmlSetNsProp(reinterpret_cast<xmlNode*>(xmlnode_),
431  definition,
432  dprop->name,
433  dprop->defaultValue);
434  if (!new_attr)
435  throw xml::exception("cannot convert default attribute into a regular one");
436 
437  // It's not a default any more
438  static_cast<phantom_attr*>(phantom_prop_)->def_prop_ = NULL;
439  static_cast<phantom_attr*>(phantom_prop_)->prop_ = new_attr;
440  return;
441 }
442 //####################################################################
444  convert();
445  xmlAttrPtr prop = reinterpret_cast<xmlAttrPtr>(normalize());
446  xmlSetNsProp(reinterpret_cast<xmlNode*>(xmlnode_),
447  prop->ns,
448  prop->name,
449  reinterpret_cast<const xmlChar*>(value));
450  return;
451 }
452 //####################################################################
454  convert();
455  xmlAttrPtr prop = reinterpret_cast<xmlAttrPtr>(normalize());
456  prop->ns = NULL;
457 }
458 //####################################################################
460  if (!prefix || prefix[0] == '\0') {
461  erase_namespace();
463  }
464 
465  convert();
466  xmlAttrPtr prop = reinterpret_cast<xmlAttrPtr>(normalize());
467  xmlNs * definition(xmlSearchNs(NULL, reinterpret_cast<xmlNode*>(xmlnode_),
468  reinterpret_cast<const xmlChar*>(prefix)));
469  if (!definition)
470  throw xml::exception("Namespace definition is not found");
471  prop->ns = definition;
472  return xml::attributes::createUnsafeNamespace(definition);
473 }
474 //####################################################################
476  if (name_space.is_void()) {
477  erase_namespace();
479  }
480 
481  convert();
482  xmlAttrPtr prop = reinterpret_cast<xmlAttrPtr>(normalize());
483 
484  if (!name_space.is_safe()) {
485  prop->ns = reinterpret_cast<xmlNs*>(getUnsafeNamespacePointer(name_space));
486  }
487  else {
488  const char * prefix(name_space.get_prefix());
489  if (prefix[0] == '\0')
490  prefix = NULL;
491  xmlNs * definition(xmlSearchNs(NULL, reinterpret_cast<xmlNode*>(xmlnode_),
492  reinterpret_cast<const xmlChar*>(prefix)));
493  if (!definition)
494  throw xml::exception("Namespace definition is not found");
495  if (!xmlStrEqual(definition->href, reinterpret_cast<const xmlChar*>(name_space.get_uri())))
496  throw xml::exception("Namespace definition URI differs to the given");
497  prop->ns = definition;
498  }
499  return createUnsafeNamespace(prop->ns);
500 }
501 //####################################################################
502 
503 /*
504  * Now some friend functions
505  */
506 
507 //####################################################################
508 namespace xml {
509 
510 namespace impl {
511  //####################################################################
512  xmlAttrPtr find_prop (xmlNodePtr xmlnode,
513  const char *name, const ns *nspace) {
514 
515  // The similar check is in libxml2 static function
516  // xmlGetPropNodeInternal(...)
517  if ( (xmlnode == NULL) ||
518  (xmlnode->type != XML_ELEMENT_NODE) ||
519  (name == NULL) )
520  return NULL;
521 
522  const ns * ns_to_match = nspace;
523  const char * name_to_match = name;
524 
525  // Check first if the name is qualified
526  const char * column = strchr(name, ':');
527 
528  if (column) {
529  if (nspace)
530  return NULL; // Both namespace and the name is qualified
531 
532  if (column == name)
533  return NULL; // The name starts with :
534 
535  if (*(column + 1) == '\0')
536  return NULL; // No attribute name is given
537 
538  std::string prefix(name, column - name);
539  xmlNsPtr resolved_ns = xmlSearchNs(xmlnode->doc,
540  xmlnode,
541  reinterpret_cast<const xmlChar*>(prefix.c_str()));
542  if (!resolved_ns)
543  return NULL; // No such namespace found
544 
545  name_to_match = column + 1;
546  ns_to_match = new ns(reinterpret_cast<const char *>(resolved_ns->prefix),
547  reinterpret_cast<const char *>(resolved_ns->href));
548  }
549 
550  xmlAttrPtr prop = xmlnode->properties;
551  for (; prop != NULL; prop = prop->next) {
552  if (xmlStrEqual(prop->name,
553  reinterpret_cast<const xmlChar*>(name_to_match))) {
554  if (ns_util::attr_ns_match(prop, ns_to_match)) {
555  if (ns_to_match != nspace)
556  delete ns_to_match;
557  return prop;
558  }
559  }
560  }
561 
562  if (ns_to_match != nspace)
563  delete ns_to_match;
564  return NULL;
565  }
566  //####################################################################
567  phantom_attr* find_default_prop (xmlNodePtr xmlnode,
568  const char *name, const ns *nspace) {
569  if (xmlnode->doc != 0) {
570  xmlAttributePtr dtd_attr = 0;
571  const xmlChar* prefix = 0;
572 
573  if (nspace && strlen(nspace->get_prefix()) > 0)
574  prefix = reinterpret_cast<const xmlChar*>(nspace->get_prefix());
575 
576  if (xmlnode->doc->intSubset != 0) {
577  if (nspace)
578  dtd_attr = xmlGetDtdQAttrDesc(xmlnode->doc->intSubset,
579  xmlnode->name,
580  reinterpret_cast<const xmlChar*>(name),
581  prefix);
582  else
583  dtd_attr = xmlGetDtdAttrDesc(xmlnode->doc->intSubset,
584  xmlnode->name,
585  reinterpret_cast<const xmlChar*>(name));
586  }
587 
588  if (dtd_attr == 0 && xmlnode->doc->extSubset != 0) {
589  if (nspace)
590  dtd_attr = xmlGetDtdQAttrDesc(xmlnode->doc->extSubset,
591  xmlnode->name,
592  reinterpret_cast<const xmlChar*>(name),
593  prefix);
594  else
595  dtd_attr = xmlGetDtdAttrDesc(xmlnode->doc->extSubset,
596  xmlnode->name,
597  reinterpret_cast<const xmlChar*>(name));
598  }
599 
600  if (dtd_attr != 0 && dtd_attr->defaultValue != 0) {
601 
602  node_private_data * node_data = attach_node_private_data(xmlnode);
603 
604 
605  // Found, now check the phantom attributes list attached to the
606  // node
607  phantom_attr * current = node_data->phantom_attrs_;
608  while (current != NULL) {
609  if (current->def_prop_ == dtd_attr)
610  return current;
611  current = current->next;
612  }
613 
614  // Not found. Create a new phantom_attr structure
615  phantom_attr * new_phantom = new phantom_attr;
616  memset( new_phantom, 0, sizeof( phantom_attr ) );
617  new_phantom->def_prop_ = dtd_attr;
618 
619  current = node_data->phantom_attrs_;
620  new_phantom->next = current;
621  node_data->phantom_attrs_ = new_phantom;
622  return new_phantom;
623  }
624  }
625  return NULL;
626  }
627 }
628 
629  //####################################################################
631  const attributes::iterator &rhs) {
632  return *(lhs.pimpl_) == *(rhs.pimpl_);
633  }
634  //####################################################################
636  const attributes::iterator &rhs) {
637  return !(lhs == rhs);
638  }
639  //####################################################################
641  const attributes::const_iterator &rhs) {
642  return *(lhs.pimpl_) == *(rhs.pimpl_);
643  }
644  //####################################################################
646  const attributes::const_iterator &rhs) {
647  return !(lhs == rhs);
648  }
649  //####################################################################
650 namespace impl {
651  bool operator== (const ait_impl &lhs, const ait_impl &rhs) {
652  return ((lhs.attr_.xmlnode_ == rhs.attr_.xmlnode_) &&
653  (lhs.attr_.normalize() == rhs.attr_.normalize()));
654  }
655  //####################################################################
656  bool operator!= (const ait_impl &lhs, const ait_impl &rhs) {
657  return !(lhs == rhs);
658  }
659 }
660  //####################################################################
661 }
662 //####################################################################
const char * kInvalidDefaultIterError
Definition: ait_impl.cpp:69
This file defines the xml::ait_impl class.
This file contains the definition of the xml::attributes class.
static TDSRET convert(TDSSOCKET *tds, TDSICONV *conv, TDS_ICONV_DIRECTION direction, const char *from, size_t from_len, char *dest, size_t *dest_len)
Definition: charconv.c:57
The xml::attributes::attr class is used to hold information about one attribute.
Definition: attributes.hpp:151
void erase_namespace(void)
Unset the attribute's namespace.
Definition: ait_impl.cpp:453
const char * get_value(void) const
Get the value of this attribute.
Definition: ait_impl.cpp:350
void * normalize(void) const
Definition: ait_impl.cpp:307
ns set_namespace(const char *prefix)
Set the attribute's namespace.
Definition: ait_impl.cpp:459
void swap(attr &other)
Definition: ait_impl.cpp:287
void * get_node(void) const
Definition: ait_impl.cpp:320
void set_data(void *node, void *prop, bool def_prop)
Definition: ait_impl.cpp:294
attr & operator=(const attr &other)
Definition: ait_impl.cpp:281
bool is_default(void) const
Test if the attribute is default.
Definition: ait_impl.cpp:329
void * resolve_default_attr_ns(void) const
Definition: ait_impl.cpp:405
ns get_namespace(ns::ns_safety_type type=ns::type_safe_ns) const
Get the attribute's namespace.
Definition: ait_impl.cpp:380
void set_value(const char *value)
Set the value of this attribute.
Definition: ait_impl.cpp:443
const char * get_name(void) const
Get the name of this attribute.
Definition: ait_impl.cpp:335
Const Iterator class for accessing attribute pairs.
Definition: attributes.hpp:320
const_iterator & operator=(const const_iterator &other)
Definition: ait_impl.cpp:222
pointer operator->(void) const
Definition: ait_impl.cpp:246
void swap(const_iterator &other)
Definition: ait_impl.cpp:228
reference operator*(void) const
Definition: ait_impl.cpp:237
const_iterator & operator++(void)
prefix increment
Definition: ait_impl.cpp:255
Iterator class for accessing attribute pairs.
Definition: attributes.hpp:285
pointer operator->(void) const
Definition: ait_impl.cpp:173
iterator & operator=(const iterator &other)
Definition: ait_impl.cpp:149
impl::ait_impl * pimpl_
Definition: attributes.hpp:310
void swap(iterator &other)
Definition: ait_impl.cpp:155
reference operator*(void) const
Definition: ait_impl.cpp:164
iterator & operator++(void)
prefix increment
Definition: ait_impl.cpp:181
void swap(attributes &other)
Swap this xml::attributes object with another one.
Definition: attributes.cpp:115
friend class node
Definition: attributes.hpp:564
static xml::ns createUnsafeNamespace(void *libxml2RawNamespace)
Definition: attributes.cpp:144
static void * getUnsafeNamespacePointer(const xml::ns &name_space)
Definition: attributes.cpp:148
This exception class is thrown by xmlwrapp for all runtime XML-related errors along with the xml::par...
Definition: exception.hpp:64
the class that does all the work behind xml::attributes::iterator and xml::attributes::const_iterator...
Definition: ait_impl.hpp:67
ait_impl & operator=(const ait_impl &other)
Definition: ait_impl.cpp:92
ait_impl & operator++(void)
Definition: ait_impl.cpp:104
attributes::attr attr_
Definition: ait_impl.hpp:83
attributes::attr * get(void)
Definition: ait_impl.cpp:100
ait_impl(xmlNodePtr node, xmlAttrPtr prop, bool from_find)
Definition: ait_impl.cpp:77
The xml::node class is used to hold information about one XML node.
Definition: node.hpp:106
The xml::ns class is used to access and handle namespaces of nodes and attributes.
Definition: namespace.hpp:64
ns_safety_type
Namespace object "safety".
Definition: namespace.hpp:67
@ type_safe_ns
Definition: namespace.hpp:68
const char * get_prefix(void) const
Get the namespace prefix.
Definition: namespace.cpp:95
const char * get_uri(void) const
Get the namespace URI.
Definition: namespace.cpp:109
bool is_safe(void) const
Check if the object is safe i.e.
Definition: namespace.cpp:154
bool is_void(void) const
If a node or an attribute has no namespace, then a namespace with empty prefix and empty URI is retur...
Definition: namespace.cpp:123
char value[7]
Definition: config.c:431
This file contains declarations required for iterators dereferencing support.
static DLIST_TYPE *DLIST_NAME() next(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
Definition: dlist.tmpl.h:56
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
Definition: ncbimisc.hpp:1508
string
Definition: cgiapp.hpp:687
#define NULL
Definition: ncbistd.hpp:225
This file contains the definition of the xml::exception class.
void * get_ptr_to_attr_instance(void *)
Definition: deref_impl.cpp:119
phantom_attr * find_default_prop(xmlNodePtr xmlnode, const char *name, const ns *nspace)
Definition: ait_impl.cpp:567
xmlAttrPtr find_prop(xmlNodePtr xmlnode, const char *name, const ns *nspace)
Definition: ait_impl.cpp:512
node_private_data * attach_node_private_data(void *)
Definition: deref_impl.cpp:95
XML library namespace.
Definition: attributes.hpp:57
const char * kAdvError
Definition: node_set.cpp:104
const char * kDerefError
Definition: node_set.cpp:102
bool operator==(const attributes::iterator &lhs, const attributes::iterator &rhs)
Definition: ait_impl.cpp:630
const char * kRefError
Definition: node_set.cpp:103
bool operator!=(const attributes::iterator &lhs, const attributes::iterator &rhs)
Definition: ait_impl.cpp:635
static char tmp[2048]
Definition: utf8.c:42
static const char * prefix[]
Definition: pcregrep.c:405
static const char * column
Definition: stats.c:23
Definition: type.c:6
struct phantom_attr * phantom_attrs_
Definition: deref_impl.hpp:88
xmlAttributePtr def_prop_
Definition: deref_impl.hpp:65
struct phantom_attr * next
Definition: deref_impl.hpp:67
Modified on Fri Mar 01 10:09:10 2024 by modify_doxy.py rev. 669887