XmlValue |
#include <DbXml.hpp>class DbXml::XmlValue { public: XmlValue(); XmlValue(const std::string &value); XmlValue(const char *value); XmlValue(double value); XmlValue(bool value); XmlValue(const XmlDocument &document); XmlValue(Type type, const std::string &value); XmlValue(Type type, const XmlData &data);
virtual ~XmlValue(); XmlValue(const XmlValue &); XmlValue &operator=(const XmlValue &); bool operator==(const XmlValue &v) const bool equals(const XmlValue &v) const; bool isNull() const; ... };
The XmlValue class encapsulates the value of a node in an XML document. The type of the value may be any one of the enumerated types in the XmlValue::Type enumeration. There are convenience operators for specially handling the types of STRING, DOUBLE, and BOOLEAN, as well as a constructor to make an XmlValue from XmlDocument.
The XmlValue class provides several constructors, each of which maps a C++ type or Berkeley DB XML class onto an appropriate XmlValue type. The following table lists the constructor parameter mappings.
C++ Type or Class | XmlValue Type |
---|---|
No parameter | NONE |
std::string or const char* | STRING |
double | DOUBLE |
bool | BOOLEAN |
XmlDocument | NODE |
Type and std::string | String is converted to the specified type. |
Type and XmlData | XmlData is converted to the specified type. |
The Type may be any of of the following:
The XmlValue class implements a set of methods that test if the XmlValue is of a named type. The XmlValue class also implements a set of methods that return the XmlValue as a value of a specified type. If the XmlValue is of type variable and no query context is provided when calling the test or cast methods, or no binding can be found for the variable, an exception is thrown.
In addition to type conversion, the XmlValue class also provides DOM-like navigation functions. Using these, you can retrieve features from the underlying document, such as the parent, an attribute, or a child of the current node.
This object is not thread-safe, and can only be safely used by one thread at a time in an application.Construct an XmlValue object of value type STRING.
Construct an XmlValue object of value type DOUBLE.
Construct an XmlValue object of value type BOOLEAN.
Construct an XmlValue object of the value Type provided, converting the string value to the specified type.
Construct an XmlValue object of value type NODE.
Returns true if the XmlValue has no value (type NONE).
Determines if two XmlValue objects represent the same value. It returns true if the two XmlValue objects represent the same value.
Copyright (c) 1996,2007 Oracle. All rights reserved.