70 Diana::QVector*
ReadQVector(
int ColumnNumber,
int startline=0,
int endline=-1);
78 int WriteQVector(Diana::QVector outputVector,
bool append=
false);
88 int WriteQVectors(std::vector<Diana::QVector> outputVector,
bool append=
false);
96 bool WriteString(std::string outputString,
bool append=
false);
104 bool WriteLine(std::string line,
bool append=
true);
111 bool Comment(std::string comment);
125 std::string
ReadString(
int startline = 0,
int endline = -1);
139 std::vector<double>
ReadVector(
int ColumnNumber,
int startline=0,
int endline=-1);
147 int WriteVector(std::vector<double> outputVector,
bool append=
false);
148 int WriteVector(std::vector<int> outputVector,
bool append=
false);
158 int WriteVectors(std::vector<std::vector<double> > outputVector,
bool append=
false);
166 bool WriteQTime(Diana::QTime* qt,
bool append=
true);
173 Diana::QTime*
ReadQTime(
int startline=0);
187 int FindLine(std::string pattern,
int startline=0);
Class for reading and writing ascii text files.
std::vector< double > ReadVector()
Reads a text file into a vector. Text file should contain a list of numbers.
int WriteVector(std::vector< int > outputVector, bool append=false)
int NumberOfLines(bool ExcludeComments=true)
Returns the number of lines in the file, excluding comments by default.
QASCII(std::string filename)
normal constructor
bool Exists()
Returns true if the file exists and can be opened.
bool WriteLine(std::string line, bool append=true)
Writes a string to a file, terminated with newline.
int WriteQVectors(std::vector< Diana::QVector > outputVector, bool append=false)
Writes a vector of QVectors, each QVector in a new column. Warning: QVectors of different lengths can...
std::string ReadString(int startline=0, int endline=-1)
Reads entire file or subset of file into a string.
bool WriteQTime(Diana::QTime *qt, bool append=true)
Writes an object of type QTime.
bool Comment(std::string comment)
Writes a comment to a file; begins with '#', terminates with newline.
QASCII()
default constructor
std::string fFilename
Name of the file on disk.
virtual ~QASCII()
destructor
bool WriteString(std::string outputString, bool append=false)
Writes a string to a file.
int WriteQVector(Diana::QVector outputVector, bool append=false)
Writes data from a QVector to a file.
int FindLine(std::string pattern, int startline=0)
Finds a line matching the string pattern.
Diana::QVector * ReadQVector()
Reads a text file into a QVector. Text file should contain a list of numbers.
int WriteVectors(std::vector< std::vector< double > > outputVector, bool append=false)
Writes a vector of vectors, each vector in a new column. Warning: vectors of different lengths can be...
std::string ReadComment(int commentNumber=0)
Reads the nth comment from a file. Comments are lines beginning with '#'.
void DeleteFile()
Deletes file from disk.
Diana::QTime * ReadQTime(int startline=0)
Reads an object of type QTime.
int WriteVector(std::vector< double > outputVector, bool append=false)
Writes data from a vector to a file.