A single block in the file - this can be either a data block or a global block - they are both handled the same way
![]() | myDataList |
![]() | myHeading |
![]() | AddSaveFrame (const string & name) DEPRECIATED - use STL vector insert() on the list returned by GiveMyDataList instead |
![]() | AddSaveFrameDataItem ( const string & name, const string & value, DataValueNode::ValType type) DEPRECIATED - use STL vector insert() on the list returned by GiveMyDataList instead |
![]() | AddSaveFrameLoop () DEPRECIATED - use STL vector insert() on the list returned by GiveMyDataList instead |
![]() | AddSaveFrameLoopDataName (const string & name) DEPRECIATED - use STL vector insert() on the list returned by GiveMyDataList instead |
![]() | AddSaveFrameLoopDataValue ( const string & value, DataValueNode::ValType type ) DEPRECIATED - use STL vector insert() on the list returned by GiveMyDataList instead |
![]() | AddSaveFrameToDataBlock (DataNode* newNode) DEPRECIATED - use STL vector insert() on the list returned by GiveMyDataList instead |
![]() | GiveMyDataList (void) Return the list of data nodes that reside inside this block node: This list is a vector and can be used like the STL vector to add/delete/iterate over the the things in the block |
![]() | isOfType ( ASTtype T ) |
![]() | myLongestStr ( void ) Returns the length of the longest string in this object |
![]() | myName () const Return the label of this block node, eg "data_foo" : |
![]() | myType (void) |
![]() | RemoveSaveFrame (string saveframeName) DEPRECIATED - use STL vector erase() on the list returned by GiveMyDataList instead |
![]() | ReturnDataBlockDataNode (string saveframeName) Return the data node matching the name given (A save frame, data item, or loop) |
![]() | searchByTag ( string &searchFor) Given a tag name, find the AST object it resides in |
![]() | searchByTagValue ( string &tag, string &value ) Given a tag name and a value, find the AST object that that particular tag and value pair resides in |
![]() | searchForType ( ASTtype type, int delim = -1 ) This method returns a list of all the nodes of the given type that are inside this node, or children of this node, or children of children of this node, etc all the way down to the leaf nodes |
![]() | unlinkChild ( ASTnode *child ) unlinks the given ASTnode from this ASTnode, assuming that the given ASTnode is a child of this ASTnode |
![]() | Unparse (int indent) |
![]() | ~BlockNode () Destructor. This will destruct everything inside the block as well. |
![]() | | ||||||||||
![]() |
|
A single block in the file - this can be either a data block or a global block - they are both handled the same way
BlockNode(HeadingNode *h, DataListNode *n)
BlockNode(const string & name)
BlockNode( BlockNode &n )
BlockNode( bool link, BlockNode &n )
In the interest of saving memory, the preComment ability
only exists at the level of saveframenodes and blocknodes.
If you attempt to use these functions at other levels,
nothing will happen (the comment will always be empty).
The string must contain the comment characters embedded
inside, like so: "# this is a\n# multiline comment.",
not like this: "this is a\nmultiline comment." This is
so that the caller is allowed to have the comment contain
blank lines like this:
Note that the comment lines are not syntax-checked in any way, so
using these functions it is entirely possible to create invalid
STAR files, since these "comments" can really be strings with
anything at all in them - so be careful.
To get rid of the preComment if you change your mind, set it to
a zero-length string with setPreComment().
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.
WARNING: The list returned is allocated in heap space. It is
the caller's responsibility to delete the list after it is no
longer needed.
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".)
WARNING: The list returned is allocated in heap space. It is
the caller's responsibility to delete the list after it is no
longer needed.
virtual ASTnode::ASTtype myType(void)
virtual bool isOfType( ASTtype T )
virtual const string& getPreComment( void )
virtual void setPreComment( const string &cmt )
# This is an example comment.
# The comment has some blank
# lines in it.
If the Unparse() function were designed to insert the comment
characters (#) itself, then such a comment block would be impossible
to create.
ASTlist <DataNode*> * GiveMyDataList(void)
string myName() const
DataNode* ReturnDataBlockDataNode(string saveframeName)
void RemoveSaveFrame(string saveframeName)
Remove the data item matching the name given (usually
a save frame).
void AddSaveFrameToDataBlock(DataNode* newNode)
Attach the given data node (usually a save frame) to the
AST. Note that it just makes a link to the object, not a
copy. Do not delete the object after calling this.
virtual void Unparse(int indent)
StarFileNode::Status AddSaveFrame(const string & name)
Add an empty save frame to the end of the block, using the name
given:
StarFileNode::Status AddSaveFrameDataItem( const string & name, const string & value, DataValueNode::ValType type)
Add a new item (tag/value pair) to the block in the last saveframe
of he block. If the last thing in the block is not a save frame,
returns ERROR
StarFileNode::Status AddSaveFrameLoop()
Add a new empty loop to the last saveframe in the block. Returns
ERROR if the last thing in the block is not a save frame. Note
that no name is given, because the name of a loop is derived
from its first tag name - and an empty loop has no first tag.
StarFileNode::Status AddSaveFrameLoopDataName(const string & name)
Add a tag name to the last loop of the last save frame in the
block. Returns ERROR if the last thing in the block is not
a save frame, or if the last thing in the save frame is not a loop.
StarFileNode::Status AddSaveFrameLoopDataValue( const string & value, DataValueNode::ValType type )
Add a value to the last loop of the last save frame in the
block. Returns ERROR if the last thing in the block is not
a save frame, or if the last thing in the save frame is not a loop.
virtual List <ASTnode*> * searchByTag( string &searchFor)
virtual List <ASTnode*> * searchForType( ASTtype type, int delim = -1 )
delim - the delimiter type if searching for a DataValueNode. The
default is "dont-care". virtual List <ASTnode*> * searchByTagValue( string &tag, string &value )
value - Where it has this value virtual bool unlinkChild( ASTnode *child )
protected : DataListNode* myDataList
HeadingNode* myHeading
virtual int myLongestStr( void )
alphabetic index hierarchy of classes
generated by doc++