#include <PropaneFileReader.h>
Public Member Functions | |
| PropaneFileReader (char *filename) | |
| Construct, opening the reader to a file. | |
| PropaneFileReader () | |
| Construct, opening no file. | |
| virtual | ~PropaneFileReader () |
| Destructor. | |
| virtual std::string | getString (std::string key) |
| Returns a string associated with a key. | |
| virtual int | getInteger (std::string key) |
| Returns an integer associated with a key. | |
| virtual bool | ready () |
| When true, the file is ready for reading. | |
Protected Member Functions | |
| void | reset () |
| Resets the stream position to the start of the file. | |
| bool | hasKey (std::string key) |
| Checks for the presence of a given key in the file. | |
| std::string | getValueForKey (std::string key) |
| Returns the string value associated with a key. | |
Protected Attributes | |
| std::ifstream | theFile |
| The raw file stream. | |
| bool | isReady |
| Internal variable holding the readiness of the file stream. | |
|
|
Construct, opening the reader to a file. Constructs the file reader around a file. Make sure to check ready() after opening the file to ensure that the process worked.
|
|
|
Construct, opening no file. Default constructor stub. Does NOTHING. |
|
|
Destructor. Basic destructor. Closes the file handle, if necessary. |
|
|
Returns an integer associated with a key. Get the right-hand integer from a string=integer pair.
|
|
|
Returns a string associated with a key. Get the right-hand string from a string=string pair
|
|
|
Returns the string value associated with a key. Gets the value for a given key/value pair as a string
|
|
|
Checks for the presence of a given key in the file. Checks to see if the current file contains a key/value pair with a key matching that of the provided one
|
|
|
When true, the file is ready for reading. Checks if the file is ready for reading
|
|
|
Resets the stream position to the start of the file. Resets the position of the file reader using ostream::seekg. |
1.4.6