17 #ifndef INPUT_OUTPUT_BASE_H 18 #define INPUT_OUTPUT_BASE_H 50 virtual void PrintTree(
int numIndent) = 0;
66 std::list<IOVarBase*>::iterator varIter =
VarList.begin();
67 while ((varIter !=
VarList.end()) && ((*varIter)->GetName() != name))
70 bool found = varIter !=
VarList.end();
72 readVarSuccess = (*varIter)->Read(var);
78 return readVarSuccess;
83 std::list<IOVarBase*>::iterator iter =
VarList.begin();
84 while ((iter !=
VarList.end()) && ((*iter)->GetName() != name))
99 std::list<IOVarBase*>::iterator iter =
VarList.begin();
101 while ((iter !=
VarList.end()) && (i != num))
120 virtual bool OpenFile(std::string fileName, std::string mySectionName,
IOTreeClass* parent) = 0;
121 virtual bool NewFile(std::string fileName, std::string mySectionName,
IOTreeClass* parent) = 0;
129 bool WriteVar(std::string name, T val);
130 template<
typename T,
int LEN>
132 template<
typename T,
int RANK>
134 template<
typename T,
int RANK,
int LEN>
142 inline bool AppendVar(std::string name, T val);
170 return var->
Write(val, 0);
179 std::list<IOTreeClass*>::iterator sectionIter;
184 if ((name == (*sectionIter)->Name) || (name ==
""))
195 std::list<IOVarBase*>::iterator varIter;
198 while (varIter !=
VarList.end())
216 std::list<IOTreeClass*>::iterator Iter =
SectionList.begin();
218 while (counter <= num && Iter !=
SectionList.end())
220 if ((*Iter)->Name == name)
238 std::list<IOTreeClass*>::iterator iter;
void InsertSection(IOTreeClass *newSec)
bool WriteVar(std::string name, T val)
These create a new variable with the given name and value:
bool Write(const Array< T, RANK > &val, T0 s0, T1 s1, T2 s2, T3 s3, T4 s4, T5 s5, T6 s6, T7 s7, T8 s8, T9 s9, T10 s10)
Write functions ///.
int CountSections(std::string name)
Returns the number of subsections with the given name within the present section. ...
IOVarBase * GetVarPtr(int num)
IOVarBase * GetVarPtr(std::string name)
bool FindSection(std::string name, IOTreeClass *§ionPtr, int num=0)
FindSection locates a subsection with the given name within the section in contains and returns it in...
This class stores a tree of input file sections.
virtual bool OpenFile(std::string fileName, std::string mySectionName, IOTreeClass *parent)=0
virtual int GetExtent(int dim)=0
std::list< IOVarBase * > VarList
void SetUnderscores(bool use)
virtual void FlushFile()=0
virtual IOTreeClass * NewSection(std::string name)=0
Write me!
virtual void IncludeSection(IOTreeClass *)=0
Inserts a new Include directive in the present section.
bool ReadVar(std::string name, T &var)
virtual IOFileType GetFileType()=0
std::string FileName
This is the empty std::string unless I'm the root node of some file.
std::list< IOTreeClass * > SectionList
virtual bool NewFile(std::string fileName, std::string mySectionName, IOTreeClass *parent)=0
int MyNumber
This is used to ensure proper ordering of sections in the HDF version in which there is no guarantee ...
virtual void PrintTree()=0
virtual void CloseFile()=0
bool AppendVar(std::string name, T val)
Append a value to a variable of dimension of 1 higher than val.
virtual void Resize(int n)=0
Resizes the first dimension of the variable.