HydraExpress 4.6 |
HydraExpress C++ API Reference Guide |
|
Container for holding class instances that represent members of XML Binding classes. More...
#include <rwsf/xmlbinding/Member.h>
Public Member Functions | |
Member () | |
virtual std::vector< Member > | get (const rwsf::XmlName &member) |
virtual void | set (const rwsf::XmlName &member, const std::vector< Member > &values) |
virtual int | exists (const rwsf::XmlName &member) |
Static Public Member Functions | |
template<class T > | |
static Member | createPrimitive (const T &value) |
template<class T > | |
static Member | createTyped (const T &value) |
static std::vector< rwsf::Member > | get (rwsf::Member m, std::string xpath) |
static std::vector< rwsf::Member > | get (rwsf::Member m, std::string xpath, const rwsf::XmlNamespaceStack &nsStack) |
static void | set (rwsf::Member m, std::string xpath, const std::vector< rwsf::Member > &values) |
static int | exists (rwsf::Member m, std::string xpath) |
Related Functions | |
(Note that these are not member functions.) | |
template<class T > | |
void | operator>> (const Member &m, T &value) |
Class rwsf::Member is a container for holding class instances that represent members of XML Binding classes. rwsf::Member instances provide a generic way of returning values using the get()
interface and of passing values using the set()
interface of each XML Binding class.
rwsf::Member::Member | ( | ) | [inline] |
Constructs an empty member handle.
static Member rwsf::Member::createPrimitive | ( | const T & | value | ) | [inline, static] |
Returns a new rwsf::Member instance templatized on a primitive type. As a primitive type, this instance contains no instances of nested classes, and so has no generic get()
, set()
, and exists()
methods.
static Member rwsf::Member::createTyped | ( | const T & | value | ) | [inline, static] |
Returns a new rwsf::Member instance templatized on code-generated types representing XML Schema complex content an XML type. This instance provides generic get()
, set()
, and exists()
methods to access its members.
static int rwsf::Member::exists | ( | rwsf::Member | m, | |
std::string | xpath | |||
) | [static] |
Determines whether xpath represents a valid path to the member contained by rwsf::Member m.
Return values are:
The XPath expression must be relative, beginning either with a dot (.) or with an identifier. The leaf node may be either an element or an attribute. For attributes, you can use the "@" character for clarity, but it is not required.
These are the restrictions when creating a new member for a valid path that lacks a member:
virtual int rwsf::Member::exists | ( | const rwsf::XmlName & | member | ) | [inline, virtual] |
Determines whether the specified member exists within this
. If the member contains an array of elements (maxOccurs>1
), returns its length. If the member contains a single element, returns 1
. If member does not exist, returns -1
.
static std::vector<rwsf::Member> rwsf::Member::get | ( | rwsf::Member | m, | |
std::string | xpath, | |||
const rwsf::XmlNamespaceStack & | nsStack | |||
) | [static] |
A generic get
that supports access to nested members by name without having to specify the type of the member. This method uses the XPath expression xpath to return the values for nested members contained in rwsf::Member m. The return vector contains rwsf::Member instances that wrap the values of the elements or attributes contained in the member.The XPath expression must be relative, beginning either with a dot (.) or with an identifier. The leaf node may be either an element or an attribute. For attributes, you can use the "@" character for clarity, but it is not required.If the path is valid but the member does not exist, the method returns an empty vector. If the path is not valid, the method throws an rwsf::Exception.
The namespace stack parameter nsStack allows member names qualified with a namespace to be resolved.
static std::vector<rwsf::Member> rwsf::Member::get | ( | rwsf::Member | m, | |
std::string | xpath | |||
) | [static] |
A generic get
that supports access to nested members by name without having to specify the type of the member. This method uses the XPath expression xpath to return the values for nested members contained in rwsf::Member m. The return vector contains rwsf::Member instances that wrap the values of the elements or attributes contained in the member.
The XPath expression must be relative, beginning either with a dot (.) or with an identifier. The leaf node may be either an element or an attribute. For attributes, you can use the "@" character for clarity, but it is not required.
If the path is valid but the member does not exist, the method returns an empty vector. If the path is not valid, the method throws an rwsf::Exception.
virtual std::vector<Member> rwsf::Member::get | ( | const rwsf::XmlName & | member | ) | [inline, virtual] |
Returns the values associated with the child member named member as a vector.
static void rwsf::Member::set | ( | rwsf::Member | m, | |
std::string | xpath, | |||
const std::vector< rwsf::Member > & | values | |||
) | [static] |
A generic set
that supports setting the values of nested members by name without having to specify the type of the member. This method uses the XPath expression xpath to set the values for a nested member contained in rwsf::Member m based on the values contained in values.
The XPath expression must relative, beginning either with a dot (.) or with an identifier. The leaf node may be either an element or an attribute. For attributes, you can use the "@" character for clarity, but it is not required.
If the path is valid but m does not exist, this method creates it.
If the path is not valid, this method throws an rwsf::Exception.
virtual void rwsf::Member::set | ( | const rwsf::XmlName & | member, | |
const std::vector< Member > & | values | |||
) | [inline, virtual] |
Sets the values of the child member named member, using the data in the rwsf::Member instances contained in the vector values.
void operator>> | ( | const Member & | m, | |
T & | value | |||
) | [related] |
Stores the value of m in value.
Copyright © Rogue Wave Software, Inc. All Rights Reserved.
The Rogue Wave name and logo are registered trademarks of Rogue Wave Software, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.