E57 Foundation API v1.1.312
Aug. 10, 2011
|
An E57 element encoding a Unicode character string value. More...
Public Member Functions | |
StringNode (ImageFile destImageFile, const ustring value="") | |
Create an element storing a Unicode character string. | |
ustring | value () const |
Get Unicode character string value stored. | |
operator Node () const | |
Upcast a StringNode handle to a generic Node handle. | |
StringNode (const Node &n) | |
Downcast a generic Node handle to a StringNode handle. | |
bool | isRoot () const |
Is this a root node. | |
Node | parent () const |
Return parent of node, or self if a root node. | |
ustring | pathName () const |
Get absolute pathname of node. | |
ustring | elementName () const |
Get elementName string, that identifies the node in its parent.. | |
ImageFile | destImageFile () const |
Get the ImageFile that was declared as the destination for the node when it was created. | |
bool | isAttached () const |
Has node been attached into the tree of an ImageFile. | |
void | dump (int indent=0, std::ostream &os=std::cout) const |
Diagnostic function to print internal state of object to output stream in an indented format. | |
void | checkInvariant (bool doRecurse=true, bool doUpcast=true) |
Check whether StringNode class invariant is true. |
An E57 element encoding a Unicode character string value.
A StringNode is a terminal node (i.e. having no children) that holds an Unicode character string encoded in UTF-8. Once the StringNode value is set at creation, it may not be modified.
See Node class discussion for discussion of the common functions that StructureNode supports.
A class invariant is a list of statements about an object that are always true before and after any operation on the object. An invariant is useful for testing correct operation of an implementation. Statements in an invariant can involve only externally visible state, or can refer to internal implementation-specific state that is not visible to the API user. The following C++ code checks externally visible state for consistency and throws an exception if the invariant is violated:
void StringNode::checkInvariant(bool /*doRecurse*/, bool doUpcast) { // If destImageFile not open, can't test invariant (almost every call would throw) if (!destImageFile().isOpen()) return; // If requested, call Node::checkInvariant if (doUpcast) static_cast<Node>(*this).checkInvariant(false, false); } // end StringNode::checkInvariant