![]() |
Vault
4.1
|
VBentoNode represents an object in the data hierarchy; objects can have named/typed attributes attached to them, as well as contained (child) objects. More...
#include <vbento.h>
Public Member Functions | |
virtual | ~VBentoNode () |
Destructor, deletes the object and all of its attribute objects and contained child objects. | |
VBentoNode () | |
Constructs an uninitialized object. | |
VBentoNode (const VString &name) | |
Constructs a named object. | |
VBentoNode (const VBentoNode &original) | |
void | addChildNode (VBentoNode *node) |
Adds a child to the object. | |
VBentoNode * | addNewChildNode (const VString &name) |
Adds a new child to the object. | |
void | addInt (const VString &name, int value) |
Adds the specified attribute to the node. | |
void | addBool (const VString &name, bool value) |
Adds the specified attribute to the node. | |
void | addString (const VString &name, const VString &value, const VString &encoding=VString::EMPTY()) |
Adds the specified attribute to the node. | |
void | addStringIfNotEmpty (const VString &name, const VString &value, const VString &encoding=VString::EMPTY()) |
Adds the specified string to the node if its length is non-zero. | |
void | addChar (const VString &name, const VCodePoint &value) |
Adds the specified attribute to the node. | |
void | addDouble (const VString &name, VDouble value) |
Adds the specified attribute to the node. | |
void | addDuration (const VString &name, const VDuration &value) |
Adds the specified attribute to the node. | |
void | addInstant (const VString &name, const VInstant &value) |
Adds the specified attribute to the node. | |
void | addSize (const VString &name, const VSize &value) |
Adds the specified attribute to the node. | |
void | addISize (const VString &name, const VISize &value) |
Adds the specified attribute to the node. | |
void | addPoint (const VString &name, const VPoint &value) |
Adds the specified attribute to the node. | |
void | addIPoint (const VString &name, const VIPoint &value) |
Adds the specified attribute to the node. | |
void | addPoint3D (const VString &name, const VPoint3D &value) |
Adds the specified attribute to the node. | |
void | addIPoint3D (const VString &name, const VIPoint3D &value) |
Adds the specified attribute to the node. | |
void | addLine (const VString &name, const VLine &value) |
Adds the specified attribute to the node. | |
void | addILine (const VString &name, const VILine &value) |
Adds the specified attribute to the node. | |
void | addRect (const VString &name, const VRect &value) |
Adds the specified attribute to the node. | |
void | addIRect (const VString &name, const VIRect &value) |
Adds the specified attribute to the node. | |
void | addPolygon (const VString &name, const VPolygon &value) |
Adds the specified attribute to the node. | |
void | addIPolygon (const VString &name, const VIPolygon &value) |
Adds the specified attribute to the node. | |
void | addColor (const VString &name, const VColor &value) |
Adds the specified attribute to the node. | |
void | addS8 (const VString &name, Vs8 value) |
Adds the specified attribute to the node. | |
void | addU8 (const VString &name, Vu8 value) |
Adds the specified attribute to the node. | |
void | addS16 (const VString &name, Vs16 value) |
Adds the specified attribute to the node. | |
void | addU16 (const VString &name, Vu16 value) |
Adds the specified attribute to the node. | |
void | addS32 (const VString &name, Vs32 value) |
Adds the specified attribute to the node. | |
void | addU32 (const VString &name, Vu32 value) |
Adds the specified attribute to the node. | |
void | addS64 (const VString &name, Vs64 value) |
Adds the specified attribute to the node. | |
void | addU64 (const VString &name, Vu64 value) |
Adds the specified attribute to the node. | |
void | addFloat (const VString &name, VFloat value) |
Adds the specified attribute to the node. | |
void | addBinary (const VString &name, const Vu8 *data, Vs64 length) |
Adds the specified attribute to the node by copying the supplied data. | |
void | addBinary (const VString &name, Vu8 *data, VMemoryStream::BufferAllocationType allocationType, bool adoptBuffer, Vs64 suppliedBufferSize, Vs64 suppliedEOFOffset) |
Adds the specified attribute to the node, using VMemoryStream::adoptBuffer() semantics. | |
VBentoS8Array * | addS8Array (const VString &name) |
Adds the specified attribute to the node. | |
VBentoS8Array * | addS8Array (const VString &name, const Vs8Array &value) |
Adds the specified attribute with array data to the node. | |
VBentoS16Array * | addS16Array (const VString &name) |
Adds the specified attribute to the node. | |
VBentoS16Array * | addS16Array (const VString &name, const Vs16Array &value) |
Adds the specified attribute with array data to the node. | |
VBentoS32Array * | addS32Array (const VString &name) |
Adds the specified attribute to the node. | |
VBentoS32Array * | addS32Array (const VString &name, const Vs32Array &value) |
Adds the specified attribute with array data to the node. | |
VBentoS64Array * | addS64Array (const VString &name) |
Adds the specified attribute to the node. | |
VBentoS64Array * | addS64Array (const VString &name, const Vs64Array &value) |
Adds the specified attribute with array data to the node. | |
VBentoStringArray * | addStringArray (const VString &name) |
Adds the specified attribute to the node. | |
VBentoStringArray * | addStringArray (const VString &name, const VStringVector &value) |
Adds the specified attribute with array data to the node. | |
VBentoBoolArray * | addBoolArray (const VString &name) |
Adds the specified attribute to the node. | |
VBentoBoolArray * | addBoolArray (const VString &name, const VBoolArray &value) |
Adds the specified attribute with array data to the node. | |
VBentoDoubleArray * | addDoubleArray (const VString &name) |
Adds the specified attribute to the node. | |
VBentoDoubleArray * | addDoubleArray (const VString &name, const VDoubleArray &value) |
Adds the specified attribute with array data to the node. | |
VBentoDurationArray * | addDurationArray (const VString &name) |
Adds the specified attribute to the node. | |
VBentoDurationArray * | addDurationArray (const VString &name, const VDurationVector &value) |
Adds the specified attribute with array data to the node. | |
VBentoInstantArray * | addInstantArray (const VString &name) |
Adds the specified attribute to the node. | |
VBentoInstantArray * | addInstantArray (const VString &name, const VInstantVector &value) |
Adds the specified attribute with array data to the node. | |
void | writeToStream (VBinaryIOStream &stream) const |
Writes the object, including its attributes and contained child objects, to a binary data stream. | |
void | writeToBentoTextStream (VTextIOStream &stream, bool lineWrap=false, int indentDepth=0) const |
Writes the object, including its attributes and contained child objects, to a text stream in Bento Text Format. | |
void | writeToBentoTextString (VString &s, bool lineWrap=false) const |
Writes the object, including its attributes and contained child objects, to a text stream in Bento Text Format. | |
VBentoNode (VBinaryIOStream &stream) | |
Constructs an object by reading it (including its attributes and contained child objects) from a Bento binary data stream. | |
VBentoNode (VTextIOStream &bentoTextStream) | |
Constructs an object by reading it (including its attributes and contained child objects) from a Bento Text stream. | |
void | readFromStream (VBinaryIOStream &stream) |
Reads the object (including its attributes and contained child objects) from a Bento binary data stream. | |
void | readFromBentoTextStream (VTextIOStream &bentoTextStream) |
Reads the object (including its attributes and contained child objects) from a Bento Text stream. | |
void | readFromBentoTextString (const VString &bentoTextString) |
Reads the object (including its attributes and contained child objects) from a Bento Text string. | |
VBentoNode * | getParentNode () const |
Returns a pointer to the parent node. | |
const VBentoNodePtrVector & | getNodes () const |
Returns the vector of contained child objects attached to this object. | |
const VBentoNode * | findNode (const VString &nodeName) const |
Returns a contained child object, searched by name, that is attached to this object. | |
const VBentoNode * | findNode (const VString &nodeName, const VString &attributeName, const VString &dataType) const |
Returns a contained child object, searched by name+attribute+dataType, that is attached to this object. | |
int | getInt (const VString &name, int defaultValue) const |
Returns the value of the specified attribute, or the supplied default value if no such attribute exists. | |
int | getInt (const VString &name) const |
Returns the value of the specified attribute, or throws an exception if no such attribute exists. | |
bool | getBool (const VString &name, bool defaultValue) const |
Returns the value of the specified attribute, or the supplied default value if no such attribute exists. | |
bool | getBool (const VString &name) const |
Returns the value of the specified attribute, or throws an exception if no such attribute exists. | |
const VString & | getString (const VString &name, const VString &defaultValue) const |
Returns the value of the specified string attribute, or the supplied default value if no such string attribute exists. | |
const VString & | getString (const VString &name) const |
Returns the value of the specified string attribute, or throws an exception if no such string attribute exists. | |
const VCodePoint & | getChar (const VString &name, const VCodePoint &defaultValue) const |
Returns the value of the specified char attribute, or the supplied default value if no such attribute exists. | |
const VCodePoint & | getChar (const VString &name) const |
Returns the value of the specified char attribute, or throws an exception if no such string attribute exists. | |
VDouble | getDouble (const VString &name, VDouble defaultValue) const |
Returns the value of the specified attribute, or the supplied default value if no such attribute exists. | |
VDouble | getDouble (const VString &name) const |
Returns the value of the specified attribute, or throws an exception if no such attribute exists. | |
const VDuration & | getDuration (const VString &name, const VDuration &defaultValue) const |
Returns the value of the specified attribute, or the supplied default value if no such attribute exists. | |
const VDuration & | getDuration (const VString &name) const |
Returns the value of the specified attribute, or throws an exception if no such attribute exists. | |
const VInstant & | getInstant (const VString &name, const VInstant &defaultValue) const |
Returns the value of the specified attribute, or the supplied default value if no such attribute exists. | |
const VInstant & | getInstant (const VString &name) const |
Returns the value of the specified attribute, or throws an exception if no such attribute exists. | |
const VSize & | getSize (const VString &name, const VSize &defaultValue) const |
const VSize & | getSize (const VString &name) const |
const VISize & | getISize (const VString &name, const VISize &defaultValue) const |
const VISize & | getISize (const VString &name) const |
const VPoint & | getPoint (const VString &name, const VPoint &defaultValue) const |
const VPoint & | getPoint (const VString &name) const |
const VIPoint & | getIPoint (const VString &name, const VIPoint &defaultValue) const |
const VIPoint & | getIPoint (const VString &name) const |
const VPoint3D & | getPoint3D (const VString &name, const VPoint3D &defaultValue) const |
const VPoint3D & | getPoint3D (const VString &name) const |
const VIPoint3D & | getIPoint3D (const VString &name, const VIPoint3D &defaultValue) const |
const VIPoint3D & | getIPoint3D (const VString &name) const |
const VLine & | getLine (const VString &name, const VLine &defaultValue) const |
const VLine & | getLine (const VString &name) const |
const VILine & | getILine (const VString &name, const VILine &defaultValue) const |
const VILine & | getILine (const VString &name) const |
const VRect & | getRect (const VString &name, const VRect &defaultValue) const |
const VRect & | getRect (const VString &name) const |
const VIRect & | getIRect (const VString &name, const VIRect &defaultValue) const |
const VIRect & | getIRect (const VString &name) const |
const VPolygon & | getPolygon (const VString &name, const VPolygon &defaultValue) const |
const VPolygon & | getPolygon (const VString &name) const |
const VIPolygon & | getIPolygon (const VString &name, const VIPolygon &defaultValue) const |
const VIPolygon & | getIPolygon (const VString &name) const |
const VColor & | getColor (const VString &name, const VColor &defaultValue) const |
const VColor & | getColor (const VString &name) const |
Vs8 | getS8 (const VString &name, Vs8 defaultValue) const |
Returns the value of the specified Vs8 attribute, or the supplied default value if no such Vs8 attribute exists. | |
Vs8 | getS8 (const VString &name) const |
Returns the value of the specified Vs8 attribute, or throws an exception if no such Vs8 attribute exists. | |
Vu8 | getU8 (const VString &name, Vu8 defaultValue) const |
Returns the value of the specified Vu8 attribute, or the supplied default value if no such Vu8 attribute exists. | |
Vu8 | getU8 (const VString &name) const |
Returns the value of the specified Vu8 attribute, or throws an exception if no such Vu8 attribute exists. | |
Vs16 | getS16 (const VString &name, Vs16 defaultValue) const |
Returns the value of the specified Vs16 attribute, or the supplied default value if no such Vs16 attribute exists. | |
Vs16 | getS16 (const VString &name) const |
Returns the value of the specified Vs16 attribute, or throws an exception if no such Vs16 attribute exists. | |
Vu16 | getU16 (const VString &name, Vu16 defaultValue) const |
Returns the value of the specified Vu16 attribute, or the supplied default value if no such Vu16 attribute exists. | |
Vu16 | getU16 (const VString &name) const |
Returns the value of the specified Vu16 attribute, or throws an exception if no such Vu16 attribute exists. | |
Vs32 | getS32 (const VString &name, Vs32 defaultValue) const |
Returns the value of the specified Vs32 attribute, or the supplied default value if no such Vs32 attribute exists. | |
Vs32 | getS32 (const VString &name) const |
Returns the value of the specified Vs32 attribute, or throws an exception if no such Vs32 attribute exists. | |
Vu32 | getU32 (const VString &name, Vu32 defaultValue) const |
Returns the value of the specified Vu32 attribute, or the supplied default value if no such Vu32 attribute exists. | |
Vu32 | getU32 (const VString &name) const |
Returns the value of the specified Vu32 attribute, or throws an exception if no such Vu32 attribute exists. | |
Vs64 | getS64 (const VString &name, Vs64 defaultValue) const |
Returns the value of the specified Vs64 attribute, or the supplied default value if no such Vs64 attribute exists. | |
Vs64 | getS64 (const VString &name) const |
Returns the value of the specified Vs64 attribute, or throws an exception if no such Vs64 attribute exists. | |
Vu64 | getU64 (const VString &name, Vu64 defaultValue) const |
Returns the value of the specified Vu64 attribute, or the supplied default value if no such Vu64 attribute exists. | |
Vu64 | getU64 (const VString &name) const |
Returns the value of the specified Vu64 attribute, or throws an exception if no such Vu64 attribute exists. | |
VFloat | getFloat (const VString &name, VFloat defaultValue) const |
Returns the value of the specified VFloat attribute, or the supplied default value if no such VFloat attribute exists. | |
VFloat | getFloat (const VString &name) const |
Returns the value of the specified VFloat attribute, or throws an exception if no such VFloat attribute exists. | |
bool | getBinary (const VString &name, VReadOnlyMemoryStream &returnedReader) const |
Returns true and sets returnedReader if the specified binary data attribute exists, or returns false and does not touch returendReader if no such binary data attribute exists. | |
VReadOnlyMemoryStream | getBinary (const VString &name) const |
Returns a reader on the specified binary data attribute, or throws an exception if no such binary data attribute exists. | |
const Vs8Array & | getS8Array (const VString &name, const Vs8Array &defaultValue) const |
Returns the value of the specified Vs8 array attribute, or the supplied default value if no such Vs8 attribute exists. | |
const Vs8Array & | getS8Array (const VString &name) const |
Returns the value of the specified Vs8 array attribute, or throws an exception if no such Vs8 attribute exists. | |
const Vs16Array & | getS16Array (const VString &name, const Vs16Array &defaultValue) const |
Returns the value of the specified Vs16 array attribute, or the supplied default value if no such Vs16 attribute exists. | |
const Vs16Array & | getS16Array (const VString &name) const |
Returns the value of the specified Vs16 array attribute, or throws an exception if no such Vs16 attribute exists. | |
const Vs32Array & | getS32Array (const VString &name, const Vs32Array &defaultValue) const |
Returns the value of the specified Vs32 array attribute, or the supplied default value if no such Vs32 attribute exists. | |
const Vs32Array & | getS32Array (const VString &name) const |
Returns the value of the specified Vs32 array attribute, or throws an exception if no such Vs32 attribute exists. | |
const Vs64Array & | getS64Array (const VString &name, const Vs64Array &defaultValue) const |
Returns the value of the specified Vs64 array attribute, or the supplied default value if no such Vs64 attribute exists. | |
const Vs64Array & | getS64Array (const VString &name) const |
Returns the value of the specified Vs64 array attribute, or throws an exception if no such Vs64 attribute exists. | |
const VStringVector & | getStringArray (const VString &name, const VStringVector &defaultValue) const |
Returns the value of the specified VString array attribute, or the supplied default value if no such VString attribute exists. | |
const VStringVector & | getStringArray (const VString &name) const |
Returns the value of the specified VString array attribute, or throws an exception if no such VString attribute exists. | |
const VBoolArray & | getBoolArray (const VString &name, const VBoolArray &defaultValue) const |
Returns the value of the specified VBool array attribute, or the supplied default value if no such VBool attribute exists. | |
const VBoolArray & | getBoolArray (const VString &name) const |
Returns the value of the specified VBool array attribute, or throws an exception if no such VBool attribute exists. | |
const VDoubleArray & | getDoubleArray (const VString &name, const VDoubleArray &defaultValue) const |
Returns the value of the specified VDouble array attribute, or the supplied default value if no such VDouble attribute exists. | |
const VDoubleArray & | getDoubleArray (const VString &name) const |
Returns the value of the specified VDouble array attribute, or throws an exception if no such VDouble attribute exists. | |
const VDurationVector & | getDurationArray (const VString &name, const VDurationVector &defaultValue) const |
Returns the value of the specified VDuration array attribute, or the supplied default value if no such VDuration attribute exists. | |
const VDurationVector & | getDurationArray (const VString &name) const |
Returns the value of the specified VDuration array attribute, or throws an exception if no such VDuration attribute exists. | |
const VInstantVector & | getInstantArray (const VString &name, const VInstantVector &defaultValue) const |
Returns the value of the specified VInstant array attribute, or the supplied default value if no such VInstant attribute exists. | |
const VInstantVector & | getInstantArray (const VString &name) const |
Returns the value of the specified VInstant array attribute, or throws an exception if no such VInstant attribute exists. | |
void | setInt (const VString &name, int value) |
Updates or adds the specified attribute of the node. | |
void | setBool (const VString &name, bool value) |
Updates or adds the specified attribute of the node. | |
void | setString (const VString &name, const VString &value, const VString &encoding=VString::EMPTY()) |
Updates or adds the specified attribute of the node. | |
void | setChar (const VString &name, const VCodePoint &value) |
Updates or adds the specified attribute of the node. | |
void | setDouble (const VString &name, VDouble value) |
Updates or adds the specified attribute of the node. | |
void | setDuration (const VString &name, const VDuration &value) |
Updates or adds the specified attribute of the node. | |
void | setInstant (const VString &name, const VInstant &value) |
Updates or adds the specified attribute of the node. | |
void | setSize (const VString &name, const VSize &value) |
Updates or adds the specified attribute of the node. | |
void | setISize (const VString &name, const VISize &value) |
Updates or adds the specified attribute of the node. | |
void | setPoint (const VString &name, const VPoint &value) |
Updates or adds the specified attribute of the node. | |
void | setIPoint (const VString &name, const VIPoint &value) |
Updates or adds the specified attribute of the node. | |
void | setPoint3D (const VString &name, const VPoint3D &value) |
Updates or adds the specified attribute of the node. | |
void | setIPoint3D (const VString &name, const VIPoint3D &value) |
Updates or adds the specified attribute of the node. | |
void | setLine (const VString &name, const VLine &value) |
Updates or adds the specified attribute of the node. | |
void | setILine (const VString &name, const VILine &value) |
Updates or adds the specified attribute of the node. | |
void | setRect (const VString &name, const VRect &value) |
Updates or adds the specified attribute of the node. | |
void | setIRect (const VString &name, const VIRect &value) |
Updates or adds the specified attribute of the node. | |
void | setPolygon (const VString &name, const VPolygon &value) |
Updates or adds the specified attribute of the node. | |
void | setIPolygon (const VString &name, const VIPolygon &value) |
Updates or adds the specified attribute of the node. | |
void | setColor (const VString &name, const VColor &value) |
Updates or adds the specified attribute of the node. | |
void | setS64 (const VString &name, Vs64 value) |
Updates or adds the specified attribute of the node. | |
const VBentoAttributePtrVector & | getAttributes () const |
Returns the vector of attribute objects attached to this object. | |
const VBentoAttribute * | findAttribute (const VString &name, const VString &dataType) const |
const VString & | getName () const |
Returns the node's name. | |
void | setName (const VString &name) |
Sets the node's name. | |
void | writeToXMLTextStream (VTextIOStream &stream, bool lineWrap=false, int indentDepth=0) const |
Writes the object, including its attributes and contained child objects, to an XML text stream. | |
void | printXML () const |
Prints the node's XML text rendering to stdout for debugging purposes. | |
void | printHexDump (VHex &hexDump) const |
Prints the node's binary stream layout to stdout for debugging purposes. | |
void | clear () |
Deletes all attributes and children (recursive) from this node. | |
void | orphanAttributes () |
Removes all attribute references from this node. | |
void | orphanNodes () |
Removes all child node references from this node. | |
void | orphanNode (const VBentoNode *node) |
Removes a particular child node reference from this node. | |
void | adoptFrom (VBentoNode *node) |
Adopts the entire set of attributes and children from the specified node. | |
void | updateFrom (const VBentoNode &node) |
Updates this bento node with the attributes and children from the specified node, using the following rules: | |
Friends | |
class | VBentoAttribute |
class | VBentoCallbackParser |
class | VBentoString |
class | VBentoBinary |
class | VBentoUnit |
class | VBentoTextNodeParser |
class | VBentoStringArray |
bool | operator< (const VBentoNode &lhs, const VBentoNode &rhs) |
Compares nodes using their name strings. | |
bool | operator<= (const VBentoNode &lhs, const VBentoNode &rhs) |
Compares nodes using their name strings. | |
bool | operator>= (const VBentoNode &lhs, const VBentoNode &rhs) |
Compares nodes using their name strings. | |
bool | operator> (const VBentoNode &lhs, const VBentoNode &rhs) |
Compares nodes using their name strings. |
VBentoNode represents an object in the data hierarchy; objects can have named/typed attributes attached to them, as well as contained (child) objects.
VBentoNode::VBentoNode | ( | const VString & | name | ) |
Constructs a named object.
name | the name to assign to the object |
Definition at line 1415 of file vbento.cpp.
VBentoNode::VBentoNode | ( | VBinaryIOStream & | stream | ) |
Constructs an object by reading it (including its attributes and contained child objects) from a Bento binary data stream.
stream | the stream to read from |
Definition at line 1423 of file vbento.cpp.
References readFromStream().
VBentoNode::VBentoNode | ( | VTextIOStream & | bentoTextStream | ) |
Constructs an object by reading it (including its attributes and contained child objects) from a Bento Text stream.
bentoTextStream | the stream to read from |
Definition at line 1432 of file vbento.cpp.
References readFromBentoTextStream().
void VBentoNode::addChildNode | ( | VBentoNode * | node | ) |
Adds a child to the object.
This object will delete the child object when this object is destructed.
node | the child object node to add |
Definition at line 1563 of file vbento.cpp.
VBentoNode * VBentoNode::addNewChildNode | ( | const VString & | name | ) |
Adds a new child to the object.
This object will delete the child object when this object is destructed.
name | the name of the child node to create and add |
Definition at line 1568 of file vbento.cpp.
References VBentoNode().
void VBentoNode::addInt | ( | const VString & | name, |
int | value | ||
) |
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1575 of file vbento.cpp.
References addS32().
void VBentoNode::addBool | ( | const VString & | name, |
bool | value | ||
) |
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1576 of file vbento.cpp.
void VBentoNode::addString | ( | const VString & | name, |
const VString & | value, | ||
const VString & | encoding = VString::EMPTY() |
||
) |
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
encoding | the text encoding of the value string (UTF-8 assumed if not specified) |
Definition at line 1577 of file vbento.cpp.
void VBentoNode::addStringIfNotEmpty | ( | const VString & | name, |
const VString & | value, | ||
const VString & | encoding = VString::EMPTY() |
||
) |
Adds the specified string to the node if its length is non-zero.
name | the attribute name |
value | the attribute value |
encoding | the text encoding of the value string (UTF-8 assumed if not specified) |
Definition at line 1578 of file vbento.cpp.
References VString::isEmpty().
void VBentoNode::addChar | ( | const VString & | name, |
const VCodePoint & | value | ||
) |
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1579 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1580 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1581 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1582 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1583 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1584 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1585 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1586 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1587 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1588 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1589 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1590 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1591 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1592 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1593 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1594 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1595 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1596 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1597 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1598 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1599 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1600 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1601 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1602 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1603 of file vbento.cpp.
Adds the specified attribute to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1604 of file vbento.cpp.
Adds the specified attribute to the node by copying the supplied data.
name | the attribute name |
data | the data buffer to add |
length | the length of data to add |
Definition at line 1605 of file vbento.cpp.
void VBentoNode::addBinary | ( | const VString & | name, |
Vu8 * | data, | ||
VMemoryStream::BufferAllocationType | allocationType, | ||
bool | adoptBuffer, | ||
Vs64 | suppliedBufferSize, | ||
Vs64 | suppliedEOFOffset | ||
) |
Adds the specified attribute to the node, using VMemoryStream::adoptBuffer() semantics.
name | the attribute name |
data | the buffer to use |
allocationType | the way the buffer was allocated (needed if being adopted) |
adoptBuffer | true if the node is to adopt the buffer (and thus be responsible for deleting it on destruction) |
suppliedBufferSize | the size of the buffer |
suppliedEOFOffset | the EOF offset in the buffer |
Definition at line 1606 of file vbento.cpp.
VBentoS8Array * VBentoNode::addS8Array | ( | const VString & | name | ) |
Adds the specified attribute to the node.
name | the attribute name |
Definition at line 1607 of file vbento.cpp.
VBentoS8Array * VBentoNode::addS8Array | ( | const VString & | name, |
const Vs8Array & | value | ||
) |
Adds the specified attribute with array data to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1608 of file vbento.cpp.
VBentoS16Array * VBentoNode::addS16Array | ( | const VString & | name | ) |
Adds the specified attribute to the node.
name | the attribute name |
Definition at line 1609 of file vbento.cpp.
VBentoS16Array * VBentoNode::addS16Array | ( | const VString & | name, |
const Vs16Array & | value | ||
) |
Adds the specified attribute with array data to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1610 of file vbento.cpp.
VBentoS32Array * VBentoNode::addS32Array | ( | const VString & | name | ) |
Adds the specified attribute to the node.
name | the attribute name |
Definition at line 1611 of file vbento.cpp.
VBentoS32Array * VBentoNode::addS32Array | ( | const VString & | name, |
const Vs32Array & | value | ||
) |
Adds the specified attribute with array data to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1612 of file vbento.cpp.
VBentoS64Array * VBentoNode::addS64Array | ( | const VString & | name | ) |
Adds the specified attribute to the node.
name | the attribute name |
Definition at line 1613 of file vbento.cpp.
VBentoS64Array * VBentoNode::addS64Array | ( | const VString & | name, |
const Vs64Array & | value | ||
) |
Adds the specified attribute with array data to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1614 of file vbento.cpp.
VBentoStringArray * VBentoNode::addStringArray | ( | const VString & | name | ) |
Adds the specified attribute to the node.
name | the attribute name |
Definition at line 1615 of file vbento.cpp.
VBentoStringArray * VBentoNode::addStringArray | ( | const VString & | name, |
const VStringVector & | value | ||
) |
Adds the specified attribute with array data to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1616 of file vbento.cpp.
VBentoBoolArray * VBentoNode::addBoolArray | ( | const VString & | name | ) |
Adds the specified attribute to the node.
name | the attribute name |
Definition at line 1617 of file vbento.cpp.
VBentoBoolArray * VBentoNode::addBoolArray | ( | const VString & | name, |
const VBoolArray & | value | ||
) |
Adds the specified attribute with array data to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1618 of file vbento.cpp.
VBentoDoubleArray * VBentoNode::addDoubleArray | ( | const VString & | name | ) |
Adds the specified attribute to the node.
name | the attribute name |
Definition at line 1619 of file vbento.cpp.
VBentoDoubleArray * VBentoNode::addDoubleArray | ( | const VString & | name, |
const VDoubleArray & | value | ||
) |
Adds the specified attribute with array data to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1620 of file vbento.cpp.
VBentoDurationArray * VBentoNode::addDurationArray | ( | const VString & | name | ) |
Adds the specified attribute to the node.
name | the attribute name |
Definition at line 1621 of file vbento.cpp.
VBentoDurationArray * VBentoNode::addDurationArray | ( | const VString & | name, |
const VDurationVector & | value | ||
) |
Adds the specified attribute with array data to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1622 of file vbento.cpp.
VBentoInstantArray * VBentoNode::addInstantArray | ( | const VString & | name | ) |
Adds the specified attribute to the node.
name | the attribute name |
Definition at line 1623 of file vbento.cpp.
VBentoInstantArray * VBentoNode::addInstantArray | ( | const VString & | name, |
const VInstantVector & | value | ||
) |
Adds the specified attribute with array data to the node.
name | the attribute name |
value | the attribute value |
Definition at line 1624 of file vbento.cpp.
void VBentoNode::writeToStream | ( | VBinaryIOStream & | stream | ) | const |
Writes the object, including its attributes and contained child objects, to a binary data stream.
stream | the stream to write to |
Definition at line 1626 of file vbento.cpp.
References VBinaryIOStream::writeSize32(), and VBinaryIOStream::writeString().
void VBentoNode::writeToBentoTextStream | ( | VTextIOStream & | stream, |
bool | lineWrap = false , |
||
int | indentDepth = 0 |
||
) | const |
Writes the object, including its attributes and contained child objects, to a text stream in Bento Text Format.
stream | the stream to write to |
lineWrap | true if each bento node should start on its own indented line |
indentDepth | if lineWrap is true, the indent level depth of this node |
Definition at line 1647 of file vbento.cpp.
References VString::chars(), and VTextIOStream::writeString().
void VBentoNode::writeToBentoTextString | ( | VString & | s, |
bool | lineWrap = false |
||
) | const |
Writes the object, including its attributes and contained child objects, to a text stream in Bento Text Format.
Use some caution in calling this vs. writeToBentoTextStream, since the entire hierarchy must be collected into a single string here.
s | the string to write to |
lineWrap | true if each bento node should start on its own indented line |
Definition at line 1675 of file vbento.cpp.
References VString::EMPTY(), VTextIOStream::readAll(), VIOStream::seek0(), VTextIOStream::writeLineEnd(), and writeToBentoTextStream().
void VBentoNode::readFromStream | ( | VBinaryIOStream & | stream | ) |
Reads the object (including its attributes and contained child objects) from a Bento binary data stream.
This is an alternative to simply constructing the object with the stream as a constructor parameter. If you call this on a node that has already read some data from a stream (not the normal mode of use), this will update the node name and append further attributes and child nodes per the stream data.
stream | the stream to read from |
Definition at line 1686 of file vbento.cpp.
References addChildNode(), VBentoAttribute::newObjectFromStream(), VBinaryIOStream::readS32(), VBinaryIOStream::readString(), and VBentoNode().
void VBentoNode::readFromBentoTextStream | ( | VTextIOStream & | bentoTextStream | ) |
Reads the object (including its attributes and contained child objects) from a Bento Text stream.
This is an alternative to simply constructing the object with the stream as a constructor parameter. If you call this on a node that has already read some data from a stream (not the normal mode of use), this will update the node name and append further attributes and child nodes per the stream data.
bentoTextStream | the stream to read from |
Definition at line 1702 of file vbento.cpp.
void VBentoNode::readFromBentoTextString | ( | const VString & | bentoTextString | ) |
Reads the object (including its attributes and contained child objects) from a Bento Text string.
This is an alternative to simply constructing the object with the string as a constructor parameter. If you call this on a node that has already read some data from a stream (not the normal mode of use), this will update the node name and append further attributes and child nodes per the stream data.
bentoTextString | the string to read from |
Definition at line 1707 of file vbento.cpp.
VBentoNode * VBentoNode::getParentNode | ( | ) | const |
Returns a pointer to the parent node.
To change a node's parent, you must operate on the parent, telling it to addChildNode() or orphanNode(). You cannot directly modify the parent pointer.
Definition at line 1712 of file vbento.cpp.
const VBentoNodePtrVector & VBentoNode::getNodes | ( | ) | const |
Returns the vector of contained child objects attached to this object.
Definition at line 1716 of file vbento.cpp.
const VBentoNode * VBentoNode::findNode | ( | const VString & | nodeName | ) | const |
Returns a contained child object, searched by name, that is attached to this object.
This method does NOT search recursively.
nodeName | the object name to match |
Definition at line 1720 of file vbento.cpp.
References VString::equalsIgnoreCase(), and NULL.
const VBentoNode * VBentoNode::findNode | ( | const VString & | nodeName, |
const VString & | attributeName, | ||
const VString & | dataType | ||
) | const |
Returns a contained child object, searched by name+attribute+dataType, that is attached to this object.
This method does NOT search recursively.
nodeName | the object name to match |
attributeName | the attribute name to match; object must have an attribute with this name whose data type also matches |
dataType | the attribute data type to match; object must have an attribute with this data type whose name also matches |
Definition at line 1730 of file vbento.cpp.
References VString::equalsIgnoreCase(), and NULL.
int VBentoNode::getInt | ( | const VString & | name, |
int | defaultValue | ||
) | const |
Returns the value of the specified attribute, or the supplied default value if no such attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 1742 of file vbento.cpp.
References getS32().
int VBentoNode::getInt | ( | const VString & | name | ) | const |
Returns the value of the specified attribute, or throws an exception if no such attribute exists.
name | the attribute name |
Definition at line 1746 of file vbento.cpp.
References getS32().
bool VBentoNode::getBool | ( | const VString & | name, |
bool | defaultValue | ||
) | const |
Returns the value of the specified attribute, or the supplied default value if no such attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 1750 of file vbento.cpp.
References VBentoBool::DATA_TYPE_ID(), VBentoBool::getValue(), and NULL.
bool VBentoNode::getBool | ( | const VString & | name | ) | const |
Returns the value of the specified attribute, or throws an exception if no such attribute exists.
name | the attribute name |
Definition at line 1755 of file vbento.cpp.
References VBentoBool::DATA_TYPE_ID(), VBentoBool::getValue(), and NULL.
Returns the value of the specified string attribute, or the supplied default value if no such string attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 1764 of file vbento.cpp.
References VBentoString::DATA_TYPE_ID(), VBentoString::getValue(), and NULL.
Returns the value of the specified string attribute, or throws an exception if no such string attribute exists.
name | the attribute name |
Definition at line 1769 of file vbento.cpp.
References VBentoString::DATA_TYPE_ID(), VBentoString::getValue(), and NULL.
const VCodePoint & VBentoNode::getChar | ( | const VString & | name, |
const VCodePoint & | defaultValue | ||
) | const |
Returns the value of the specified char attribute, or the supplied default value if no such attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 1778 of file vbento.cpp.
References VBentoChar::DATA_TYPE_ID(), VBentoChar::getValue(), and NULL.
const VCodePoint & VBentoNode::getChar | ( | const VString & | name | ) | const |
Returns the value of the specified char attribute, or throws an exception if no such string attribute exists.
name | the attribute name |
Definition at line 1783 of file vbento.cpp.
References VBentoChar::DATA_TYPE_ID(), VBentoChar::getValue(), and NULL.
Returns the value of the specified attribute, or the supplied default value if no such attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 1792 of file vbento.cpp.
References VBentoDouble::DATA_TYPE_ID(), VBentoDouble::getValue(), and NULL.
Returns the value of the specified attribute, or throws an exception if no such attribute exists.
name | the attribute name |
Definition at line 1797 of file vbento.cpp.
References VBentoDouble::DATA_TYPE_ID(), VBentoDouble::getValue(), and NULL.
const VDuration & VBentoNode::getDuration | ( | const VString & | name, |
const VDuration & | defaultValue | ||
) | const |
Returns the value of the specified attribute, or the supplied default value if no such attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 1806 of file vbento.cpp.
References VBentoDuration::DATA_TYPE_ID(), VBentoDuration::getValue(), and NULL.
Returns the value of the specified attribute, or throws an exception if no such attribute exists.
name | the attribute name |
Definition at line 1811 of file vbento.cpp.
References VBentoDuration::DATA_TYPE_ID(), VBentoDuration::getValue(), and NULL.
const VInstant & VBentoNode::getInstant | ( | const VString & | name, |
const VInstant & | defaultValue | ||
) | const |
Returns the value of the specified attribute, or the supplied default value if no such attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 1820 of file vbento.cpp.
References VBentoInstant::DATA_TYPE_ID(), VBentoInstant::getValue(), and NULL.
Returns the value of the specified attribute, or throws an exception if no such attribute exists.
name | the attribute name |
Definition at line 1825 of file vbento.cpp.
References VBentoInstant::DATA_TYPE_ID(), VBentoInstant::getValue(), and NULL.
Returns the value of the specified Vs8 attribute, or the supplied default value if no such Vs8 attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 2016 of file vbento.cpp.
References VBentoS8::DATA_TYPE_ID(), VBentoS8::getValue(), and NULL.
Returns the value of the specified Vs8 attribute, or throws an exception if no such Vs8 attribute exists.
name | the attribute name |
Definition at line 2021 of file vbento.cpp.
References VBentoS8::DATA_TYPE_ID(), VBentoS8::getValue(), and NULL.
Returns the value of the specified Vu8 attribute, or the supplied default value if no such Vu8 attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 2030 of file vbento.cpp.
References VBentoU8::DATA_TYPE_ID(), VBentoU8::getValue(), and NULL.
Returns the value of the specified Vu8 attribute, or throws an exception if no such Vu8 attribute exists.
name | the attribute name |
Definition at line 2035 of file vbento.cpp.
References VBentoU8::DATA_TYPE_ID(), VBentoU8::getValue(), and NULL.
Returns the value of the specified Vs16 attribute, or the supplied default value if no such Vs16 attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 2044 of file vbento.cpp.
References VBentoS16::DATA_TYPE_ID(), VBentoS16::getValue(), and NULL.
Returns the value of the specified Vs16 attribute, or throws an exception if no such Vs16 attribute exists.
name | the attribute name |
Definition at line 2049 of file vbento.cpp.
References VBentoS16::DATA_TYPE_ID(), VBentoS16::getValue(), and NULL.
Returns the value of the specified Vu16 attribute, or the supplied default value if no such Vu16 attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 2058 of file vbento.cpp.
References VBentoU16::DATA_TYPE_ID(), VBentoU16::getValue(), and NULL.
Returns the value of the specified Vu16 attribute, or throws an exception if no such Vu16 attribute exists.
name | the attribute name |
Definition at line 2063 of file vbento.cpp.
References VBentoU16::DATA_TYPE_ID(), VBentoU16::getValue(), and NULL.
Returns the value of the specified Vs32 attribute, or the supplied default value if no such Vs32 attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 2072 of file vbento.cpp.
References VBentoS32::DATA_TYPE_ID(), VBentoS32::getValue(), and NULL.
Returns the value of the specified Vs32 attribute, or throws an exception if no such Vs32 attribute exists.
name | the attribute name |
Definition at line 2077 of file vbento.cpp.
References VBentoS32::DATA_TYPE_ID(), VBentoS32::getValue(), and NULL.
Returns the value of the specified Vu32 attribute, or the supplied default value if no such Vu32 attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 2086 of file vbento.cpp.
References VBentoU32::DATA_TYPE_ID(), VBentoU32::getValue(), and NULL.
Returns the value of the specified Vu32 attribute, or throws an exception if no such Vu32 attribute exists.
name | the attribute name |
Definition at line 2091 of file vbento.cpp.
References VBentoU32::DATA_TYPE_ID(), VBentoU32::getValue(), and NULL.
Returns the value of the specified Vs64 attribute, or the supplied default value if no such Vs64 attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 2100 of file vbento.cpp.
References VBentoS64::DATA_TYPE_ID(), VBentoS64::getValue(), and NULL.
Returns the value of the specified Vs64 attribute, or throws an exception if no such Vs64 attribute exists.
name | the attribute name |
Definition at line 2105 of file vbento.cpp.
References VBentoS64::DATA_TYPE_ID(), VBentoS64::getValue(), and NULL.
Returns the value of the specified Vu64 attribute, or the supplied default value if no such Vu64 attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 2114 of file vbento.cpp.
References VBentoU64::DATA_TYPE_ID(), VBentoU64::getValue(), and NULL.
Returns the value of the specified Vu64 attribute, or throws an exception if no such Vu64 attribute exists.
name | the attribute name |
Definition at line 2119 of file vbento.cpp.
References VBentoU64::DATA_TYPE_ID(), VBentoU64::getValue(), and NULL.
Returns the value of the specified VFloat attribute, or the supplied default value if no such VFloat attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 2128 of file vbento.cpp.
References VBentoFloat::DATA_TYPE_ID(), VBentoFloat::getValue(), and NULL.
Returns the value of the specified VFloat attribute, or throws an exception if no such VFloat attribute exists.
name | the attribute name |
Definition at line 2133 of file vbento.cpp.
References VBentoFloat::DATA_TYPE_ID(), VBentoFloat::getValue(), and NULL.
bool VBentoNode::getBinary | ( | const VString & | name, |
VReadOnlyMemoryStream & | returnedReader | ||
) | const |
Returns true and sets returnedReader if the specified binary data attribute exists, or returns false and does not touch returendReader if no such binary data attribute exists.
name | the attribute name |
returnedReader | a read-only memory stream that will be set to read on the attribute's binary data if it exists |
Definition at line 2142 of file vbento.cpp.
References VBentoBinary::DATA_TYPE_ID(), VBentoBinary::getReader(), and NULL.
VReadOnlyMemoryStream VBentoNode::getBinary | ( | const VString & | name | ) | const |
Returns a reader on the specified binary data attribute, or throws an exception if no such binary data attribute exists.
name | the attribute name |
Definition at line 2152 of file vbento.cpp.
References VBentoBinary::DATA_TYPE_ID(), VBentoBinary::getReader(), and NULL.
const Vs8Array & VBentoNode::getS8Array | ( | const VString & | name, |
const Vs8Array & | defaultValue | ||
) | const |
Returns the value of the specified Vs8 array attribute, or the supplied default value if no such Vs8 attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 2161 of file vbento.cpp.
References VBentoS8Array::DATA_TYPE_ID(), VBentoS8Array::getValue(), and NULL.
const Vs8Array & VBentoNode::getS8Array | ( | const VString & | name | ) | const |
Returns the value of the specified Vs8 array attribute, or throws an exception if no such Vs8 attribute exists.
name | the attribute name |
Definition at line 2166 of file vbento.cpp.
References VBentoS8Array::DATA_TYPE_ID(), VBentoS8Array::getValue(), and NULL.
const Vs16Array & VBentoNode::getS16Array | ( | const VString & | name, |
const Vs16Array & | defaultValue | ||
) | const |
Returns the value of the specified Vs16 array attribute, or the supplied default value if no such Vs16 attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 2175 of file vbento.cpp.
References VBentoS16Array::DATA_TYPE_ID(), VBentoS16Array::getValue(), and NULL.
const Vs16Array & VBentoNode::getS16Array | ( | const VString & | name | ) | const |
Returns the value of the specified Vs16 array attribute, or throws an exception if no such Vs16 attribute exists.
name | the attribute name |
Definition at line 2180 of file vbento.cpp.
References VBentoS16Array::DATA_TYPE_ID(), VBentoS16Array::getValue(), and NULL.
const Vs32Array & VBentoNode::getS32Array | ( | const VString & | name, |
const Vs32Array & | defaultValue | ||
) | const |
Returns the value of the specified Vs32 array attribute, or the supplied default value if no such Vs32 attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 2189 of file vbento.cpp.
References VBentoS32Array::DATA_TYPE_ID(), VBentoS32Array::getValue(), and NULL.
const Vs32Array & VBentoNode::getS32Array | ( | const VString & | name | ) | const |
Returns the value of the specified Vs32 array attribute, or throws an exception if no such Vs32 attribute exists.
name | the attribute name |
Definition at line 2194 of file vbento.cpp.
References VBentoS32Array::DATA_TYPE_ID(), VBentoS32Array::getValue(), and NULL.
const Vs64Array & VBentoNode::getS64Array | ( | const VString & | name, |
const Vs64Array & | defaultValue | ||
) | const |
Returns the value of the specified Vs64 array attribute, or the supplied default value if no such Vs64 attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 2203 of file vbento.cpp.
References VBentoS64Array::DATA_TYPE_ID(), VBentoS64Array::getValue(), and NULL.
const Vs64Array & VBentoNode::getS64Array | ( | const VString & | name | ) | const |
Returns the value of the specified Vs64 array attribute, or throws an exception if no such Vs64 attribute exists.
name | the attribute name |
Definition at line 2208 of file vbento.cpp.
References VBentoS64Array::DATA_TYPE_ID(), VBentoS64Array::getValue(), and NULL.
const VStringVector & VBentoNode::getStringArray | ( | const VString & | name, |
const VStringVector & | defaultValue | ||
) | const |
Returns the value of the specified VString array attribute, or the supplied default value if no such VString attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 2217 of file vbento.cpp.
References VBentoStringArray::DATA_TYPE_ID(), VBentoStringArray::getValue(), and NULL.
const VStringVector & VBentoNode::getStringArray | ( | const VString & | name | ) | const |
Returns the value of the specified VString array attribute, or throws an exception if no such VString attribute exists.
name | the attribute name |
Definition at line 2226 of file vbento.cpp.
References VBentoStringArray::DATA_TYPE_ID(), VBentoStringArray::getValue(), and NULL.
const VBoolArray & VBentoNode::getBoolArray | ( | const VString & | name, |
const VBoolArray & | defaultValue | ||
) | const |
Returns the value of the specified VBool array attribute, or the supplied default value if no such VBool attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 2235 of file vbento.cpp.
References VBentoBoolArray::DATA_TYPE_ID(), VBentoBoolArray::getValue(), and NULL.
const VBoolArray & VBentoNode::getBoolArray | ( | const VString & | name | ) | const |
Returns the value of the specified VBool array attribute, or throws an exception if no such VBool attribute exists.
name | the attribute name |
Definition at line 2240 of file vbento.cpp.
References VBentoBoolArray::DATA_TYPE_ID(), VBentoBoolArray::getValue(), and NULL.
const VDoubleArray & VBentoNode::getDoubleArray | ( | const VString & | name, |
const VDoubleArray & | defaultValue | ||
) | const |
Returns the value of the specified VDouble array attribute, or the supplied default value if no such VDouble attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 2249 of file vbento.cpp.
References VBentoDoubleArray::DATA_TYPE_ID(), VBentoDoubleArray::getValue(), and NULL.
const VDoubleArray & VBentoNode::getDoubleArray | ( | const VString & | name | ) | const |
Returns the value of the specified VDouble array attribute, or throws an exception if no such VDouble attribute exists.
name | the attribute name |
Definition at line 2254 of file vbento.cpp.
References VBentoDoubleArray::DATA_TYPE_ID(), VBentoDoubleArray::getValue(), and NULL.
const VDurationVector & VBentoNode::getDurationArray | ( | const VString & | name, |
const VDurationVector & | defaultValue | ||
) | const |
Returns the value of the specified VDuration array attribute, or the supplied default value if no such VDuration attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 2263 of file vbento.cpp.
References VBentoDurationArray::DATA_TYPE_ID(), VBentoDurationArray::getValue(), and NULL.
const VDurationVector & VBentoNode::getDurationArray | ( | const VString & | name | ) | const |
Returns the value of the specified VDuration array attribute, or throws an exception if no such VDuration attribute exists.
name | the attribute name |
Definition at line 2268 of file vbento.cpp.
References VBentoDurationArray::DATA_TYPE_ID(), VBentoDurationArray::getValue(), and NULL.
const VInstantVector & VBentoNode::getInstantArray | ( | const VString & | name, |
const VInstantVector & | defaultValue | ||
) | const |
Returns the value of the specified VInstant array attribute, or the supplied default value if no such VInstant attribute exists.
name | the attribute name |
defaultValue | the default value to return |
Definition at line 2277 of file vbento.cpp.
References VBentoInstantArray::DATA_TYPE_ID(), VBentoInstantArray::getValue(), and NULL.
const VInstantVector & VBentoNode::getInstantArray | ( | const VString & | name | ) | const |
Returns the value of the specified VInstant array attribute, or throws an exception if no such VInstant attribute exists.
name | the attribute name |
Definition at line 2282 of file vbento.cpp.
References VBentoInstantArray::DATA_TYPE_ID(), VBentoInstantArray::getValue(), and NULL.
void VBentoNode::setInt | ( | const VString & | name, |
int | value | ||
) |
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
Definition at line 2291 of file vbento.cpp.
References addInt(), VBentoS32::DATA_TYPE_ID(), NULL, and VBentoS32::setValue().
void VBentoNode::setBool | ( | const VString & | name, |
bool | value | ||
) |
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
Definition at line 2299 of file vbento.cpp.
References addBool(), VBentoBool::DATA_TYPE_ID(), NULL, and VBentoBool::setValue().
void VBentoNode::setString | ( | const VString & | name, |
const VString & | value, | ||
const VString & | encoding = VString::EMPTY() |
||
) |
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
encoding | the text encoding of the value string (UTF-8 assumed if not specified) |
Definition at line 2307 of file vbento.cpp.
References addString(), VBentoString::DATA_TYPE_ID(), NULL, VBentoString::setEncoding(), and VBentoString::setValue().
void VBentoNode::setChar | ( | const VString & | name, |
const VCodePoint & | value | ||
) |
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
Definition at line 2317 of file vbento.cpp.
References addChar(), VBentoChar::DATA_TYPE_ID(), NULL, and VBentoChar::setValue().
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
Definition at line 2325 of file vbento.cpp.
References addDouble(), VBentoDouble::DATA_TYPE_ID(), NULL, and VBentoDouble::setValue().
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
Definition at line 2333 of file vbento.cpp.
References addDuration(), VBentoDuration::DATA_TYPE_ID(), NULL, and VBentoDuration::setValue().
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
Definition at line 2341 of file vbento.cpp.
References addInstant(), VBentoInstant::DATA_TYPE_ID(), NULL, and VBentoInstant::setValue().
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
Definition at line 2349 of file vbento.cpp.
References addSize(), VBentoSize::DATA_TYPE_ID(), NULL, and VBentoSize::setValue().
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
Definition at line 2357 of file vbento.cpp.
References addISize(), VBentoISize::DATA_TYPE_ID(), NULL, and VBentoISize::setValue().
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
Definition at line 2365 of file vbento.cpp.
References addPoint(), VBentoPoint::DATA_TYPE_ID(), NULL, and VBentoPoint::setValue().
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
Definition at line 2373 of file vbento.cpp.
References addIPoint(), VBentoIPoint::DATA_TYPE_ID(), NULL, and VBentoIPoint::setValue().
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
Definition at line 2381 of file vbento.cpp.
References addPoint3D(), VBentoPoint3D::DATA_TYPE_ID(), NULL, and VBentoPoint3D::setValue().
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
Definition at line 2389 of file vbento.cpp.
References addIPoint3D(), VBentoIPoint3D::DATA_TYPE_ID(), NULL, and VBentoIPoint3D::setValue().
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
Definition at line 2397 of file vbento.cpp.
References addLine(), VBentoLine::DATA_TYPE_ID(), NULL, and VBentoLine::setValue().
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
Definition at line 2405 of file vbento.cpp.
References addILine(), VBentoILine::DATA_TYPE_ID(), NULL, and VBentoILine::setValue().
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
Definition at line 2413 of file vbento.cpp.
References addRect(), VBentoRect::DATA_TYPE_ID(), NULL, and VBentoRect::setValue().
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
Definition at line 2421 of file vbento.cpp.
References addIRect(), VBentoIRect::DATA_TYPE_ID(), NULL, and VBentoIRect::setValue().
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
Definition at line 2429 of file vbento.cpp.
References addPolygon(), VBentoPolygon::DATA_TYPE_ID(), NULL, and VBentoPolygon::setValue().
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
Definition at line 2437 of file vbento.cpp.
References addIPolygon(), VBentoIPolygon::DATA_TYPE_ID(), NULL, and VBentoIPolygon::setValue().
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
Definition at line 2445 of file vbento.cpp.
References addColor(), VBentoColor::DATA_TYPE_ID(), NULL, and VBentoColor::setValue().
Updates or adds the specified attribute of the node.
name | the attribute name |
value | the attribute value |
Definition at line 2453 of file vbento.cpp.
References addS64(), VBentoS64::DATA_TYPE_ID(), NULL, and VBentoS64::setValue().
const VBentoAttributePtrVector & VBentoNode::getAttributes | ( | ) | const |
Returns the vector of attribute objects attached to this object.
Definition at line 2461 of file vbento.cpp.
const VString & VBentoNode::getName | ( | ) | const |
Returns the node's name.
Definition at line 2465 of file vbento.cpp.
void VBentoNode::setName | ( | const VString & | name | ) |
Sets the node's name.
name | the name to give the node |
Definition at line 2469 of file vbento.cpp.
void VBentoNode::writeToXMLTextStream | ( | VTextIOStream & | stream, |
bool | lineWrap = false , |
||
int | indentDepth = 0 |
||
) | const |
Writes the object, including its attributes and contained child objects, to an XML text stream.
stream | the stream to write to |
lineWrap | true if each bento node should start on its own indented line |
indentDepth | if lineWrap is true, the indent level depth of this node |
Definition at line 2473 of file vbento.cpp.
References VString::chars(), and VTextIOStream::writeString().
void VBentoNode::clear | ( | ) |
Deletes all attributes and children (recursive) from this node.
This node remains with the same name, but everything beneath it is destroyed. Be certain that no one has retained pointers to child nodes nor references to attributes of this or any child node, before calling this method. This method may be useful if you build a Bento hierarchy, serialize it, and then wish to re-use the base node.
Definition at line 1476 of file vbento.cpp.
void VBentoNode::orphanAttributes | ( | ) |
Removes all attribute references from this node.
Presumably the caller is now responsible for those objects, including their deletion.
Definition at line 1489 of file vbento.cpp.
void VBentoNode::orphanNodes | ( | ) |
Removes all child node references from this node.
Presumably the caller is now responsible for those nodes, including their deletion.
Definition at line 1493 of file vbento.cpp.
References NULL.
void VBentoNode::orphanNode | ( | const VBentoNode * | node | ) |
Removes a particular child node reference from this node.
Presumably the caller is now responsible for the node, including its deletion. If the node is not found, nothing happens.
node | the child node to remove from this node's child list |
Definition at line 1501 of file vbento.cpp.
References NULL.
void VBentoNode::adoptFrom | ( | VBentoNode * | node | ) |
Adopts the entire set of attributes and children from the specified node.
The supplied node will be modified with calls to orphanAttributes and orphanNodes, because this node now owns those objects in memory.
node | the node from which to adopt attributes and children |
Definition at line 1509 of file vbento.cpp.
References clear(), getName(), orphanAttributes(), and orphanNodes().
void VBentoNode::updateFrom | ( | const VBentoNode & | node | ) |
Updates this bento node with the attributes and children from the specified node, using the following rules:
node | the node from which to copy attributes and children |
Definition at line 1528 of file vbento.cpp.
References addChildNode(), findNode(), getAttributes(), getName(), getNodes(), VString::isNotEmpty(), NULL, and VBentoNode().