DUtils::LineFile Class Reference
Reads and writes a file by string lines.
More...
#include <LineFile.h>
List of all members.
Detailed Description
Reads and writes a file by string lines.
Constructor & Destructor Documentation
LineFile::LineFile |
( |
void |
|
) |
|
Creates a linefile with no file
LineFile::~LineFile |
( |
void |
|
) |
|
LineFile::LineFile |
( |
const char * |
filename, |
|
|
const FILE_MODES |
mode | |
|
) |
| | |
Creates a linefile by opening a file
- Parameters:
-
| filename | |
| mode,: | READ or WRITE |
- Exceptions:
-
LineFile::LineFile |
( |
const string & |
filename, |
|
|
const FILE_MODES |
mode | |
|
) |
| | |
Creates a linefile by opening a file
- Parameters:
-
| filename | |
| mode,: | READ or WRITE |
- Exceptions:
-
Member Function Documentation
Closes any opened file. It is not necessary to call this function explicitly
void LineFile::DiscardLine |
( |
|
) |
|
In reading mode, reads and throws away the next line
void LineFile::Dump |
( |
const vector< string > & |
v |
) |
|
Writes several lines at a time
- Parameters:
-
| v,: | vector of line strings |
- Exceptions:
-
Says whether the end of the file has been reached. It is not necessary to read a last empty line to reach eof
- Returns:
- true iff there is nothing else to read
- Exceptions:
-
FILE_MODES DUtils::LineFile::GetOpenMode |
( |
|
) |
const [inline] |
void LineFile::Init |
( |
const char * |
filename, |
|
|
const FILE_MODES |
mode | |
|
) |
| | [protected] |
Initializes the object by opening a file
- Parameters:
-
| filename | file to open |
| mode | opening mode |
- Exceptions:
-
void DUtils::LineFile::OpenForAppending |
( |
const string & |
filename |
) |
[inline] |
Opens a file for writing at the end. It closes any other opened file
- Parameters:
-
- Exceptions:
-
void LineFile::OpenForAppending |
( |
const char * |
filename |
) |
|
Opens a file for writing at the end. It closes any other opened file
- Parameters:
-
- Exceptions:
-
void DUtils::LineFile::OpenForReading |
( |
const string & |
filename |
) |
[inline] |
Opens a file for reading. It closes any other opened file
- Parameters:
-
- Exceptions:
-
void LineFile::OpenForReading |
( |
const char * |
filename |
) |
|
Opens a file for reading. It closes any other opened file
- Parameters:
-
- Exceptions:
-
void DUtils::LineFile::OpenForWriting |
( |
const string & |
filename |
) |
[inline] |
Opens a file for writing. It closes any other opened file
- Parameters:
-
- Exceptions:
-
void LineFile::OpenForWriting |
( |
const char * |
filename |
) |
|
Opens a file for writing. It closes any other opened file
- Parameters:
-
- Exceptions:
-
LineFile& DUtils::LineFile::operator<< |
( |
const vector< string > & |
v |
) |
[inline] |
Writes several lines at a time
- Parameters:
-
| v,: | vector of line strings |
- Exceptions:
-
LineFile& DUtils::LineFile::operator<< |
( |
const string & |
s |
) |
[inline] |
Writes a line
- Exceptions:
-
LineFile & LineFile::operator<< |
( |
const char * |
s |
) |
|
Writes a line
- Exceptions:
-
LineFile & LineFile::operator>> |
( |
vector< string > & |
v |
) |
|
Reads all the remaining lines in the file
- Parameters:
-
| v | vector to store the lines in |
- Exceptions:
-
LineFile & LineFile::operator>> |
( |
string & |
s |
) |
|
Reads a line
- Parameters:
-
- Exceptions:
-
The documentation for this class was generated from the following files: