66 bool p_GetLine(QString &line,
bool chkComment);
73 TextFile(
const QString &filename,
const char *openmode =
"input",
74 const char *extension =
"");
77 TextFile(
const char *filename,
const char *openmode,
78 std::vector<QString> &lines,
79 const int &maxLinesToReadWrite = 0,
80 const bool skipComments =
true);
82 const char *openmode, std::vector<QString> &lines,
83 const int &maxLinesToReadWrite = 0,
84 const bool skipComments =
true);
86 const char *openmode, QString *lines,
87 const int &maxLinesToReadWrite,
const bool skipComments =
true);
89 const char *openmode, QString *lines,
90 const int &maxLinesToReadWrite,
const bool skipComments =
true);
94 void Open(
const QString &filename,
const char *openmode =
"input",
95 const char *extension =
"");
96 void Open(
const char *filename,
const char *openmode =
"input",
97 const char *extension =
"");
99 bool OpenChk(
bool bailIfNotOpen =
false);
104 void GetFile(std::vector<QString> &lines,
105 const int &maxLinesToRead = 0,
106 const bool skipComments =
true);
107 void GetFile(QString *lines,
const int &maxLinesToRead,
108 const bool skipComments =
true);
110 void PutFile(std::vector<QString> &lines,
111 const int &maxLinesToWrite = 0);
112 void PutFile(
const QString *lines,
const int &maxLinesToWrite);
114 bool GetLine(QString &line,
const bool skipComments =
true);
117 bool GetLine(
const bool skipComments =
true);
120 void PutLine(
const QString &line);
121 void PutLine(
const char *line =
"");
129 void SetComment(
const char *commentString =
"#");
130 void SetNewLine(
const char *newLineString =
"\n");
132 int LineCount(
const int &maxLinesToRead = 0);
133 std::streamsize
Size();
QString p_filename
FileName of the opened file.
Definition: TextFile.h:60
QString p_commentString
'comment' string used by GetLine and PutLineComment
Definition: TextFile.h:61
std::streamsize Size()
Counts number of bytes in file.
Definition: TextFile.cpp:668
void SetComment(const char *commentString="#")
Sets the 'comment' string.
Definition: TextFile.cpp:593
void Open(const QString &filename, const char *openmode="input", const char *extension="")
Opens a text file.
Definition: TextFile.cpp:233
void GetFile(std::vector< QString > &lines, const int &maxLinesToRead=0, const bool skipComments=true)
Definition: TextFile.cpp:350
int p_openmode
openmode of file: Input, Output, Overwrite, Append
Definition: TextFile.h:58
void Rewind()
Sets Read / Write pointer to begining of opened file.
Definition: TextFile.cpp:333
void Close()
Closes file. Called automatically by TextFile destructor.
Definition: TextFile.cpp:342
TextFile()
Constructs an empty TextFile object.
Definition: TextFile.cpp:38
bool GetLineNoFilter()
Gets next NON-COMMENT line from file.
Definition: TextFile.cpp:463
QString GetNewLine()
Definition: TextFile.cpp:598
void SetNewLine(const char *newLineString="\)
Sets the 'newline' string.
Definition: TextFile.cpp:609
QString GetComment()
Definition: TextFile.cpp:580
QString p_newLineString
'newline' string used by PutLine and PutLineComment
Definition: TextFile.h:63
int LineCount(const int &maxLinesToRead=0)
Counts number of lines in file.
Definition: TextFile.cpp:623
bool GetLine(QString &line, const bool skipComments=true)
Gets next line from file.
Definition: TextFile.cpp:427
Provides access to sequential ASCII stream I/O.
Definition: TextFile.h:54
~TextFile()
Closes file (if still open). Destroys the TextFile object.
Definition: TextFile.cpp:202
void PutLine(const QString &line)
Writes string to file and appends a 'newline' string.
Definition: TextFile.cpp:524
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
void PutLineComment(const QString &line)
Writes string to file, prepends a 'comment' string and appends a 'newline' string.
Definition: TextFile.cpp:565
bool OpenChk(bool bailIfNotOpen=false)
Definition: TextFile.cpp:317
bool p_GetLine(QString &line, bool chkComment)
Gets next line from file.
Definition: TextFile.cpp:479
void PutFile(std::vector< QString > &lines, const int &maxLinesToWrite=0)
Definition: TextFile.cpp:386
std::fstream p_stream
File stream handle.
Definition: TextFile.h:57