|
Isis Developer Reference
|
Go to the documentation of this file.
50 bool p_GetLine(QString &line,
bool chkComment);
57 TextFile(
const QString &filename,
const char *openmode =
"input",
58 const char *extension =
"");
61 TextFile(
const char *filename,
const char *openmode,
62 std::vector<QString> &lines,
63 const int &maxLinesToReadWrite = 0,
64 const bool skipComments =
true);
66 const char *openmode, std::vector<QString> &lines,
67 const int &maxLinesToReadWrite = 0,
68 const bool skipComments =
true);
70 const char *openmode, QString *lines,
71 const int &maxLinesToReadWrite,
const bool skipComments =
true);
73 const char *openmode, QString *lines,
74 const int &maxLinesToReadWrite,
const bool skipComments =
true);
78 void Open(
const QString &filename,
const char *openmode =
"input",
79 const char *extension =
"");
80 void Open(
const char *filename,
const char *openmode =
"input",
81 const char *extension =
"");
83 bool OpenChk(
bool bailIfNotOpen =
false);
88 void GetFile(std::vector<QString> &lines,
89 const int &maxLinesToRead = 0,
90 const bool skipComments =
true);
91 void GetFile(QString *lines,
const int &maxLinesToRead,
92 const bool skipComments =
true);
94 void PutFile(std::vector<QString> &lines,
95 const int &maxLinesToWrite = 0);
96 void PutFile(
const QString *lines,
const int &maxLinesToWrite);
98 bool GetLine(QString &line,
const bool skipComments =
true);
101 bool GetLine(
const bool skipComments =
true);
104 void PutLine(
const QString &line);
105 void PutLine(
const char *line =
"");
113 void SetComment(
const char *commentString =
"#");
114 void SetNewLine(
const char *newLineString =
"\n");
116 int LineCount(
const int &maxLinesToRead = 0);
117 std::streamsize
Size();
std::streamsize Size()
Counts number of bytes in file.
Definition: TextFile.cpp:652
~TextFile()
Closes file (if still open). Destroys the TextFile object.
Definition: TextFile.cpp:186
QString GetComment()
Definition: TextFile.cpp:564
IString DownCase()
Converts all upper case letters in the object IString into lower case characters.
Definition: IString.cpp:644
void Close()
Closes file. Called automatically by TextFile destructor.
Definition: TextFile.cpp:326
File name manipulation and expansion.
Definition: FileName.h:100
bool p_GetLine(QString &line, bool chkComment)
Gets next line from file.
Definition: TextFile.cpp:463
bool fileExists() const
Returns true if the file exists; false otherwise.
Definition: FileName.cpp:449
bool OpenChk(bool bailIfNotOpen=false)
Definition: TextFile.cpp:301
QString p_newLineString
'newline' string used by PutLine and PutLineComment
Definition: TextFile.h:47
TextFile()
Constructs an empty TextFile object.
Definition: TextFile.cpp:22
Provides access to sequential ASCII stream I/O.
Definition: TextFile.h:38
QString GetNewLine()
Definition: TextFile.cpp:582
bool GetLine(QString &line, const bool skipComments=true)
Gets next line from file.
Definition: TextFile.cpp:411
void GetFile(std::vector< QString > &lines, const int &maxLinesToRead=0, const bool skipComments=true)
Definition: TextFile.cpp:334
void Open(const char *filename, const char *openmode="input", const char *extension="")
int p_openmode
openmode of file: Input, Output, Overwrite, Append
Definition: TextFile.h:42
void SetNewLine(const char *newLineString="\n")
Sets the 'newline' string.
Definition: TextFile.cpp:593
void Open(const QString &filename, const char *openmode="input", const char *extension="")
Opens a text file.
Definition: TextFile.cpp:217
void PutFile(std::vector< QString > &lines, const int &maxLinesToWrite=0)
Definition: TextFile.cpp:370
int LineCount(const int &maxLinesToRead=0)
Counts number of lines in file.
Definition: TextFile.cpp:607
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:196
FileName addExtension(const QString &extension) const
Adds a new extension to the file name.
Definition: FileName.cpp:225
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
void Rewind()
Sets Read / Write pointer to begining of opened file.
Definition: TextFile.cpp:317
QString p_commentString
'comment' string used by GetLine and PutLineComment
Definition: TextFile.h:45
void SetComment(const char *commentString="#")
Sets the 'comment' string.
Definition: TextFile.cpp:577
Isis exception class.
Definition: IException.h:91
bool GetLineNoFilter()
Gets next NON-COMMENT line from file.
Definition: TextFile.cpp:447
QString toString() const
Returns a QString of the full file name including the file path, excluding the attributes with any Is...
Definition: FileName.cpp:515
void PutLine(const QString &line)
Writes string to file and appends a 'newline' string.
Definition: TextFile.cpp:508
QString p_filename
FileName of the opened file.
Definition: TextFile.h:44
Namespace for the standard library.
std::fstream p_stream
File stream handle.
Definition: TextFile.h:41
Adds specific functionality to C++ strings.
Definition: IString.h:165
void PutLineComment(const QString &line)
Writes string to file, prepends a 'comment' string and appends a 'newline' string.
Definition: TextFile.cpp:549
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16