lab_hash
Hellish Hash Tables
 All Classes Namespaces Files Functions Variables Pages
TextFile Class Reference

TextFile class: defines an interface for reading in a text file. More...

#include <textfile.h>

Collaboration diagram for TextFile:
[legend]

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...
 

Detailed Description

TextFile class: defines an interface for reading in a text file.

Author
Chase Geigle
Date
Spring 2011
Summer 2012

Constructor & Destructor Documentation

TextFile::TextFile ( const std::string filename)

Constructs a new TextFile from the given filename.

Parameters
filenameThe name of the file to read.
TextFile::~TextFile ( )

Destructor.

Ensures our file is propery closed.

Member Function Documentation

string TextFile::getNextWord ( )

Gets the next word in the file.

Returns
The next word in the file.
bool TextFile::good ( )

Determines whether more data can be read from the TextFile.

Returns
True if there is more data to be read, false otherwise.

Member Data Documentation

std::ifstream TextFile::infile
private

std::ifstream used for reading the file


The documentation for this class was generated from the following files: