class StarFileNode

The Mother Of All Star Nodes (literally).

Inheritance:


Public Methods

[more]Status AddDataBlock (const string & name)
DEPRECIATED - Use the vector insert operator of ASTlist instead.
[more]Status AddSaveFrame (const string & name)
DEPRECIATED - Use the vector insert operator of ASTlist instead.
[more]Status AddSaveFrameDataItem ( const string & name, const string & value, DataValueNode::ValType type)
DEPRECIATED - Use the vector insert operator instead.
[more]Status AddSaveFrameLoop ()
DEPRECIATED - Use the vector insert operator instead.
[more]Status AddSaveFrameLoopDataName (const string & name)
DEPRECIATED - Use the vector insert operator instead
Add a new name to the loop at the end of the last save frame of the file.
[more]Status AddSaveFrameLoopDataValue ( const string & value, DataValueNode::ValType type )
DEPRECIATED - Use the vector insert operator instead.
[more]void AddSaveFrameToDataBlock (string datablockName, DataNode* newNode)
DEPRECIATED - Use the vector insert operator of ASTlist instead.
[more]ASTlist<BlockNode*> * GiveMyDataBlockList ()
Returns a list of all blocks in the star tree.
[more]void RemoveSaveFrame (string datablockName, string saveframeName)
DEPRECIATED - Use the delete operator insread, or see List::erase (STL vector erase):
Deletes the save frame name given in the data block name given:
[more]DataNode* ReturnDataBlockDataNode (string datablockName, string saveframeName)
DEPRECIATED - see searchByTag instead:
Returns the save frame matching the name given in the data block name given:
[more]virtual void Unparse (int indent)
Print the whole star file out to (*os), indenting it to the level given in the parameter.
[more]virtual bool isOfType ( ASTtype T )
[more]virtual ASTnode::ASTtype myType (void)
[more]virtual List<ASTnode*> * searchByTag ( string &searchFor )
Given a tag name, find the AST object it resides in.
[more]virtual List<ASTnode*> * 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.
[more]virtual List<ASTnode*> * 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.
[more]virtual bool unlinkChild ( ASTnode* child )
Unlinks the given ASTnode from this ASTnode, assuming that the given ASTnode is a child of this ASTnode.
[more]virtual ~StarFileNode ()

Public Members

[more]
[more]enum Status
This status is sometimes returned by functions to report errors


Inherited from ASTnode:

Public Methods

obool NotVirtualIsOfType( ASTtype T )
ovirtual void copyFrom( const ASTnode &copyFromMe )
ovirtual ASTnode* myParent(void)
ovirtual bool removeChild( ASTnode* child )
ovirtual bool removeMe( void )
ovirtual void setParent( ASTnode* p )
ovirtual bool unlinkMe( void )

Public Members

oenum ASTtype

Protected Methods

ovoid printIndent(int indent)


Inherited from ASTnodeWithPosBits:


Documentation

The Mother Of All Star Nodes (literally). This node is the root of the star tree for a whole star file. If a star file is parsed in with yyparse(), it produces an object of this type, which in turn contains the rest of the star tree.
oenum Status
This status is sometimes returned by functions to report errors

o OK

o ERROR

o

o StarFileNode(StarFileNode &n)
Make a copy of the star file tree (recurses down)

o StarFileNode(StarListNode* n)
Make a trivial shallow copy

o StarFileNode()
Make an empty star file tree:

o StarFileNode( bool link, StarFileNode &n)
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.

ovirtual ~StarFileNode()

ovirtual void Unparse(int indent)
Print the whole star file out to (*os), indenting it to the level given in the parameter. (i.e. 4 = 4 spaces indented.)

ovirtual ASTnode::ASTtype myType(void)

ovirtual bool isOfType( ASTtype T )

oDataNode* ReturnDataBlockDataNode(string datablockName, string saveframeName)
DEPRECIATED - see searchByTag instead:
Returns the save frame matching the name given in the data block name given:
See Also:
searchByTag

ovoid RemoveSaveFrame(string datablockName, string saveframeName)
DEPRECIATED - Use the delete operator insread, or see List::erase (STL vector erase):
Deletes the save frame name given in the data block name given:
See Also:
List::erase

ovoid AddSaveFrameToDataBlock(string datablockName, DataNode* newNode)
DEPRECIATED - Use the vector insert operator of ASTlist instead.
Given a save frame, adds it to the datablock name given. The save frame is passed as a generic DataNode, rather than a SaveFrameNode. The DataNode given is hooked right into the star tree, no copied, so don't delete it after adding it.
See Also:
ASTlist::insert

oASTlist<BlockNode*> * GiveMyDataBlockList()
Returns a list of all blocks in the star tree. This list can be manipulated directly to insert, erase, or iterate over items from the tree, using the STL vector operators.

oStatus AddDataBlock(const string & name)
DEPRECIATED - Use the vector insert operator of ASTlist instead.
Add a new datablock (empty) to the star file, labelling it with the name given. Adds at the end.
See Also:
ASTlist::insert

oStatus AddSaveFrame(const string & name)
DEPRECIATED - Use the vector insert operator of ASTlist instead.
Add an empty save frame to the star file, labelling it eith the name given. Adds at the end.
See Also:
ASTlist::insert

oStatus AddSaveFrameDataItem( const string & name, const string & value, DataValueNode::ValType type)
DEPRECIATED - Use the vector insert operator instead.
Add a data item to the save frame, with the name/value pair given. Adds to the last save frame in the star file tree. returns ERROR if the last thing in the star file is not a save frame.
See Also:
ASTlist::insert

oStatus AddSaveFrameLoop()
DEPRECIATED - Use the vector insert operator instead.
Add a loop to the last save frame in the star file. returns ERROR if the last thing in the star file is not a save frame.
See Also:
ASTlist::insert

oStatus AddSaveFrameLoopDataName(const string & name)
DEPRECIATED - Use the vector insert operator instead
Add a new name to the loop at the end of the last save frame of the file. returns ERROR if the last thing in the save frame is not a loop, or if the last thing in the AST is not a save frame.
See Also:
ASTlist::insert

oStatus AddSaveFrameLoopDataValue( const string & value, DataValueNode::ValType type )
DEPRECIATED - Use the vector insert operator instead.
Add a new value to the end of the loop at the end of the last save frame of the file. returns ERROR if the last thing in the save frame is not a loop, or if the last thing in the AST is not a save frame.
See Also:
ASTlist::insert

ovirtual List<ASTnode*> * searchByTag( string &searchFor )
Given a tag name, find the AST object it resides in. It returns a pointer to the lowest level AST object that the tag resides in. The caller of this function needs to use the isOfType() and/or myType() methods to determine what type to cst the object. Returns a NULL if nothing was found.

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.

Parameters:
searchFor - - Look for this string as the tag name.

ovirtual List<ASTnode*> * 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.
Parameters:
type - - the type to search for
delim - - the delimiter type to search for if this is a search for DataValueNodes (enum DataValueNode::ValType) Leave it off if you don't care about delimiter type or if this is a search for something other than a DataValueNode

ovirtual List<ASTnode*> * 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. This is like performing an SQL search: WHERE tag = value.

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.

Parameters:
- tag - Look for this tag.
value - - Where it has this value.

ovirtual 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.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java


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