lab_hash
Hellish Hash Tables
TextFile Class Reference

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

#include "textfile.h"

+ Collaboration diagram for TextFile:

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::TextFile ( const std::string filename)

Constructs a new TextFile from the given filename.

Parameters
filenameThe name of the file to read.

◆ ~TextFile()

TextFile::~TextFile ( )

Destructor.

Ensures our file is propery closed.

Member Function Documentation

◆ good()

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.

◆ getNextWord()

string TextFile::getNextWord ( )

Gets the next word in the file.

Returns
The next word in the file.

Member Data Documentation

◆ infile

std::ifstream TextFile::infile
private

std::ifstream used for reading the file


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