lab_hash
Hellish Hash Tables
|
TextFile class: defines an interface for reading in a text file. More...
#include "textfile.h"
Public Member Functions | |
TextFile (const std::string &filename) | |
Constructs a new TextFile from the given filename. More... | |
~TextFile () | |
Destructor. More... | |
bool | good () |
Determines whether more data can be read from the TextFile. More... | |
std::string | getNextWord () |
Gets the next word in the file. More... | |
Private Attributes | |
std::ifstream | infile |
std::ifstream used for reading the file More... | |
TextFile class: defines an interface for reading in a text file.
TextFile::TextFile | ( | const std::string & | filename | ) |
Constructs a new TextFile from the given filename.
filename | The name of the file to read. |
TextFile::~TextFile | ( | ) |
Destructor.
Ensures our file is propery closed.
bool TextFile::good | ( | ) |
Determines whether more data can be read from the TextFile.
string TextFile::getNextWord | ( | ) |
Gets the next word in the file.
|
private |
std::ifstream used for reading the file