C++/Tree Mapping Runtime Library
|
Class corresponding to the XML Schema anyType built-in type. More...
#include <elements.hxx>
Classes | |
class | bad_dom_node_type |
Exception indicating that a DOM node cannot be associated with an object model node. More... | |
Constructors | |
_type () | |
Default constructor. | |
template<typename C > | |
_type (const C *s) | |
Create an instance from a C string. | |
_type (const type &x, flags f=0, container *c=0) | |
Copy constructor. | |
virtual type * | _clone (flags f=0, container *c=0) const |
Copy the instance polymorphically. | |
template<typename S > | |
_type (istream< S > &s, flags f=0, container *c=0) | |
Create an instance from a data representation stream. | |
_type (const xercesc::DOMElement &e, flags f=flags::extract_content, container *c=0) | |
Create an instance from a DOM element. | |
_type (const xercesc::DOMAttr &a, flags f=0, container *c=0) | |
Create an instance from a DOM Attribute. | |
template<typename C > | |
_type (const std::basic_string< C > &s, const xercesc::DOMElement *e, flags f=0, container *c=0) | |
Create an instance from a string fragment. | |
type & | operator= (const type &x) |
Copy assignment operator. | |
const dom_content_optional & | dom_content () const |
Return a read-only (constant) reference to the anyType DOM content. | |
dom_content_optional & | dom_content () |
Return a read-write reference to the anyType DOM content. | |
void | dom_content (const xercesc::DOMElement &e) |
Set the anyType DOM content. | |
void | dom_content (xercesc::DOMElement *e) |
Set the anyType DOM content. | |
void | dom_content (const dom_content_optional &d) |
Set the anyType DOM content. | |
const xercesc::DOMDocument & | dom_content_document () const |
Return a read-only (constant) reference to the DOM document associated with this anyType instance. | |
xercesc::DOMDocument & | dom_content_document () |
Return a read-write reference to the DOM document associated with this anyType instance. | |
bool | null_content () const |
Check for absence of DOM (anyType) and text (anySimpleType) content. | |
const container * | _container () const |
Get a constant pointer to container, an object model node that contains this instance. | |
container * | _container () |
Get a pointer to container, an object model node that contains this instance. | |
virtual void | _container (container *c) |
Set this instance's new container, an object model node that contains this instance. | |
const container * | _root () const |
Get a constant pointer to object model's root node. | |
container * | _root () |
Get a pointer to object model's root node. | |
const xercesc::DOMNode * | _node () const |
Get a constant pointer to a DOM node associated with this object model node. | |
xercesc::DOMNode * | _node () |
Get a pointer to a DOM node associated with this object model node. | |
void | _node (xercesc::DOMNode *n) |
Manually set a DOM node associated with this object model node. | |
bool | operator== (const type &x, const type &y) |
Comparison operator. It uses DOM (anyType) or text (anySimpleType) content if present. If the content is missing then the types are assumed unequal. | |
bool | operator!= (const type &x, const type &y) |
Comparison operator. It uses DOM (anyType) or text (anySimpleType) content if present. If the content is missing then the types are assumed unequal. | |
Class corresponding to the XML Schema anyType built-in type.
This class is a base for every generated and built-in type in the C++/Tree mapping.
|
explicit |
Create an instance from a C string.
s | A string to initialize the instance with. |
Note that this constructor ignores the string and creates an empty anyType instance. In particular, it will not convert the string into DOM content. The purpose of such a strange constructor is to allow statically-initialized default values of anyType type.
Copy constructor.
x | An instance to make a copy of. |
f | Flags to create the copy with. |
c | A pointer to the object that will contain the copy. |
For polymorphic object models use the _clone
function instead.
Create an instance from a data representation stream.
s | A stream to extract the data from. |
f | Flags to create the new instance with. |
c | A pointer to the object that will contain the new instance. |
_type | ( | const xercesc::DOMElement & | e, |
flags | f = flags::extract_content , |
||
container * | c = 0 |
||
) |
Create an instance from a DOM element.
e | A DOM element to extract the data from. |
f | Flags to create the new instance with. |
c | A pointer to the object that will contain the new instance. |
Create an instance from a DOM Attribute.
a | A DOM attribute to extract the data from. |
f | Flags to create the new instance with. |
c | A pointer to the object that will contain the new instance. |
_type | ( | const std::basic_string< C > & | s, |
const xercesc::DOMElement * | e, | ||
flags | f = 0 , |
||
container * | c = 0 |
||
) |
Create an instance from a string fragment.
s | A string fragment to extract the data from. |
e | A pointer to DOM element containing the string fragment. |
f | Flags to create the new instance with. |
c | A pointer to the object that will contain the new instance. |
Copy the instance polymorphically.
f | Flags to create the copy with. |
c | A pointer to the object that will contain the copy. |
This function ensures that the dynamic type of the instance is used for copying and should be used for polymorphic object models instead of the copy constructor.
Copy assignment operator.
x | An instance to assign. |
const dom_content_optional & dom_content | ( | ) | const |
Return a read-only (constant) reference to the anyType DOM content.
The DOM content is returned as an optional element container, the same container as used for optional element wildcards.
dom_content_optional & dom_content | ( | ) |
Return a read-write reference to the anyType DOM content.
The DOM content is returned as an optional element container, the same container as used for optional element wildcards.
void dom_content | ( | const xercesc::DOMElement & | e | ) |
Set the anyType DOM content.
e | A new element to set. |
This function makes a copy of its argument and sets it as the new DOM content.
void dom_content | ( | xercesc::DOMElement * | e | ) |
Set the anyType DOM content.
e | A new element to use. |
This function will use the passed element directly instead of making a copy. For this to work the element should belong to the DOM document associated with this anyType instance.
void dom_content | ( | const dom_content_optional & | d | ) |
Set the anyType DOM content.
d | An optional container with the new element to set. |
If the element is present in d then this function makes a copy of this element and sets it as the new wildcard content. Otherwise the element container is set the 'not present' state.
const xercesc::DOMDocument & dom_content_document | ( | ) | const |
Return a read-only (constant) reference to the DOM document associated with this anyType instance.
The DOM document returned by this function is used to store the raw XML content corresponding to the anyType instance.
xercesc::DOMDocument & dom_content_document | ( | ) |
Return a read-write reference to the DOM document associated with this anyType instance.
The DOM document returned by this function is used to store the raw XML content corresponding to the anyType instance.
bool null_content | ( | ) | const |
Check for absence of DOM (anyType) and text (anySimpleType) content.
This is an optimization function that allows us to check for the lack of content without actually creating its empty representation (that is, empty DOM document for DOM or empty string for text).
|
inline |
Get a constant pointer to container, an object model node that contains this instance.
Referenced by _type::_container().
|
inline |
Get a pointer to container, an object model node that contains this instance.
|
inlinevirtual |
Set this instance's new container, an object model node that contains this instance.
c | A pointer to container. |
References _type::_container(), and _type::_root().
|
inline |
Get a constant pointer to object model's root node.
Referenced by _type::_container(), and _type::_node().
|
inline |
Get a pointer to object model's root node.
|
inline |
Get a constant pointer to a DOM node associated with this object model node.
Referenced by _type::_node().
|
inline |
Get a pointer to a DOM node associated with this object model node.
|
inline |
Manually set a DOM node associated with this object model node.
The DOM node should be a child of the parent's DOM node. If this object model node is a root of the tree, then it will assume the ownership of the whole DOM document to which this DOM node belongs.
n | A pointer to DOM node (should be either an element or an attribute). |
References _type::_node(), and _type::_root().
Comparison operator. It uses DOM (anyType) or text (anySimpleType) content if present. If the content is missing then the types are assumed unequal.
Comparison operator. It uses DOM (anyType) or text (anySimpleType) content if present. If the content is missing then the types are assumed unequal.