class DataItemNode : public DataNode

Holds a single tag name / tag value pair

Inheritance:


Public Methods

virtual bool isOfType ( ASTtype T )
DataValueNode::ValType myDelimType (void) const
Returns the delimiter type of the value of this Data Item.
virtual int myLongestStr ( void ) const
Returns the length of the longest string in this object
virtual string myName () const
Return the name of the tag in this item.
virtual ASTnode::ASTtype myType (void)
string myValue () const
Return the value of this item.
virtual ASTlist <DataValueNode *> * returnLoopValues (const string & tagName)
Dummy do-nothing function needed to handle the fact that this is derived from DataNode, which defines this function as virtual
virtual List <ASTnode*> * searchByTag ( string &searchFor )
Included for orthogonality with ASTnode
virtual List <ASTnode*> * searchByTagValue ( string &tag, string &value )
Included for orthogonality with ASTnode
virtual List <ASTnode*> * searchForType ( ASTtype type, int delim = -1 )
Included for orthogonality with ASTnode
void setDelimType ( DataValueNode::ValType )
Sets the delimiter type of the value of this Data Item.
virtual bool unlinkChild ( ASTnode *child )
unlinks the given ASTnode from this ASTnode, assuming that the given ASTnode is a child of this ASTnode
virtual void Unparse (int indent, int padsize)
virtual void Unparse (int indent)
virtual ~DataItemNode ()
Destructor.

Public


void setValue ( const string &val )
void setValue ( const char *val )

Sets the string value of this node

void setName ( const string &name )
void setName ( const char *name )

Both these functions set the name of the tag

DataItemNode (DataNameNode *name, DataValueNode *value)
Make a new item given the name and value
DataItemNode (const string & name, const string & value)
Make a new item given the name and value as strings
DataItemNode (const string & name, const string & value, DataValueNode::ValType type)
Make a new item given the name and value and delimiter type
DataItemNode (DataItemNode & D)
Copy Constructor
DataItemNode ( bool link, DataItemNode & D)
Copy with parallel link

Inherited from DataNode:


Inherited from ASTnode:

Public Classes

enum ASTtype
ASTNODE
BLOCKNODE
DATABLOCKNODE
DATAFILENODE
DATAHEADINGNODE
DATAITEMNODE
DATALISTNODE
DATALOOPNAMELISTNODE
DATALOOPDEFLISTNODE
DEPRECIATED - Do not use:
DATALOOPNODE
DATALOOPVALLISTNODE
DATANAMENODE
DATANODE
DATAVALUENODE
GLOBALBLOCKNODE
GLOBALHEADINGNODE
HEADINGNODE
LOOPROWNODE
ITERNODE
DEPRECIATED - Do not use:
LOOPNAMELISTNODE
LOOPDEFLISTNODE
DEPRECIATED - Do not use:
LOOPTABLENODE
LOOPITER
DEPRECIATED - Do not use:
LOOPVALLISTNODE
DEPRECIATED - Do not use:
SAVEFRAMELISTNODE
SAVEFRAMENODE
SAVEHEADINGNODE
STARLISTNODE
STARFILENODE

Public Methods

virtual void copyFrom( const ASTnode ©FromMe )
virtual ASTnode* myParent(void)
bool NotVirtualIsOfType( ASTtype T )
virtual bool removeChild( ASTnode *child )
virtual bool removeMe( void )
virtual void setParent( ASTnode *p )
virtual size_t sizeOfMe(void)
virtual bool unlinkMe( void )

Documentation

Holds a single tag name / tag value pair
virtual ASTnode::ASTtype myType(void)

virtual bool isOfType( ASTtype T )

DataItemNode(DataNameNode *name, DataValueNode *value)
Make a new item given the name and value. Note that these pointers refer to memory that you are "giving" to the node (don't delete them afterward, and don't pass addresses to stack variables - only addresses to heap variables.)

DataItemNode(const string & name, const string & value)
Make a new item given the name and value as strings. The delimiter type will be chosen heuristicly as one that is legal for the value given.

DataItemNode(const string & name, const string & value, DataValueNode::ValType type)
Make a new item given the name and value and delimiter type. Note that no checking is done to ensure that the delimiter type given is appropriate for the value given. (It is possible to make a value with spaces and tell it to be nonquoted, for example.)

DataItemNode(DataItemNode & D)
Copy Constructor

DataItemNode( bool link, DataItemNode & D)
Copy with parallel link. Set "link" to true to create a copy with a parallel link, or set it to false to create a copy without a parallel link. See the external documentation for more details on parallel copies.

virtual ~DataItemNode()
Destructor.

virtual string myName() const
Return the name of the tag in this item.

string myValue() const
Return the value of this item.

virtual ASTlist <DataValueNode *> * returnLoopValues(const string & tagName)
Dummy do-nothing function needed to handle the fact that this is derived from DataNode, which defines this function as virtual

virtual void Unparse(int indent)

virtual void Unparse(int indent, int padsize)

DataValueNode::ValType myDelimType(void) const
Returns the delimiter type of the value of this Data Item.

void setDelimType( DataValueNode::ValType )
Sets the delimiter type of the value of this Data Item.

void setValue( const string &val )

void setValue( const char *val )

Sets the string value of this node. Do not use delimiters, instead use setDelimType to chose the delimiter style. just use the raw string here.

void setName( const string &name )

void setName( const char *name )

Both these functions set the name of the tag. You should provide the leading undescore.

virtual List <ASTnode*> * searchByTag( string &searchFor )
Included for orthogonality with ASTnode. Not really very useful at this scope.

This search is case-insensitive. The names of things, according to the STAR specification, are supposed to be case-insensitive. This is being applied not only to tag names but also to saveframe names and datablock names.

virtual List <ASTnode*> * searchForType( ASTtype type, int delim = -1 )
Included for orthogonality with ASTnode. Not really very useful at this scope.

virtual List <ASTnode*> * searchByTagValue( string &tag, string &value )
Included for orthogonality with ASTnode. Not really very useful at this scope.

This search is case-insensitive. The names of things, according to the STAR specification, are supposed to be case-insensitive. This is being applied not only to tag names but also to saveframe names and datablock names.

(However, the values are case-sensitive. A search for a tag of _t1 is identical to a search for a tag of _T1, but a search for a value of "V1" is different from a search for a value of "v1".)

virtual bool unlinkChild( ASTnode *child )
unlinks the given ASTnode from this ASTnode, assuming that the given ASTnode is a child of this ASTnode. Does NOT call the destructor of the child node!! Use this function to remove the child from this ASTnode but not free it's space. RETURNS: true if the child was unlinked. false if the given ASTnode was not even in this class anywhere, and therefore nothing was done. This function MUST be overridden for each subclass of ASTnode.

virtual int myLongestStr( void ) const
Returns the length of the longest string in this object. Used by Unparse() at various levels of the AST tree. (In this case, it just returns the length of the tagname, not the data value)


This class has no child classes.

alphabetic index hierarchy of classes


Starlib is a creation of BioMagResBank: bmrb.wisc.edu starlib banner

generated by doc++