SIVIC API  0.9.26
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
svkXMLUtils Class Reference

#include <svkXMLUtils.h>

Inheritance diagram for svkXMLUtils:

Public Member Functions

 vtkTypeMacro (svkXMLUtils, vtkObject)
 

Static Public Member Functions

static svkXMLUtilsNew ()
 
static vtkXMLDataElement * CreateNestedXMLDataElement (vtkXMLDataElement *parent, string name, string value)
 
static vtkXMLDataElement * ReadXMLAndSubstituteVariables (string xmlFileName, vector< string > xmlVariables)
 
static vtkXMLDataElement * FindNestedElementWithPath (vtkXMLDataElement *root, string xmlPath)
 
static bool GetNestedElementCharacterDataWithPath (vtkXMLDataElement *root, string xmlPath, string *data)
 
static bool SetNestedElementWithPath (vtkXMLDataElement *root, string xmlPath, string value)
 
static void ReadLine (ifstream *fs, istringstream *iss)
 
static vector< string > SplitString (string str, string token)
 

Protected Member Functions

 svkXMLUtils ()
 Constructor. More...
 
 ~svkXMLUtils ()
 Destructor. More...
 

Detailed Description

UCSF specific utilities.

Constructor & Destructor Documentation

svkXMLUtils ( )
protected

Constructor.

~svkXMLUtils ( )
protected

Destructor.

Member Function Documentation

vtkXMLDataElement * CreateNestedXMLDataElement ( vtkXMLDataElement *  parent,
string  name,
string  value 
)
static
vtkXMLDataElement * FindNestedElementWithPath ( vtkXMLDataElement *  root,
string  xmlPath 
)
static

Finds a nested element at a depth greater than one. Searches from the root node, and assumes a '/' separated list of nested elements. Returns null if no element exists at the requested path.

References svkXMLUtils::SplitString().

Referenced by svkDataAcquisitionDescriptionXML::FindNestedElementWithPath(), svkXMLUtils::GetNestedElementCharacterDataWithPath(), and svkXMLUtils::SetNestedElementWithPath().

bool GetNestedElementCharacterDataWithPath ( vtkXMLDataElement *  root,
string  xmlPath,
string *  data 
)
static

Method finds a nested element and then grabs the character data and puts it into the data string provided as an argument. If the character data is retrieved then the method returns true, otherwise false.

References svkXMLUtils::FindNestedElementWithPath().

Referenced by svkDataAcquisitionDescriptionXML::GetDataWithPath().

static svkXMLUtils* New ( )
static
void ReadLine ( ifstream *  fs,
istringstream *  iss 
)
static

Utility function to read a single line from a file stream.

vtkXMLDataElement * ReadXMLAndSubstituteVariables ( string  xmlFileName,
vector< string >  xmlVariables 
)
static

This method reads an xml file and then substitutes varibales from variables vectors. Each element in the variables vector is expected to have the format: VARIBALE_NAME=value. For this case any string the xml matching $VARIABLE_NAME will be replaced with 'value'.

bool SetNestedElementWithPath ( vtkXMLDataElement *  root,
string  xmlPath,
string  value 
)
static

Sets the character data for a given xml path relative to a root element. If the element exists then it will be set and true will be returned. Otherwise false will be returned.

References svkXMLUtils::FindNestedElementWithPath().

Referenced by svkDataAcquisitionDescriptionXML::SetDataWithPath().

vector< string > SplitString ( string  str,
string  token 
)
static
vtkTypeMacro ( svkXMLUtils  ,
vtkObject   
)

The documentation for this class was generated from the following files: