|
iCub-main
|
Template class that supports reading lines of a file to object instances using a fromString(char* line) method (e.g. More...
#include <FileReaderT.h>
Public Member Functions | |
| FileReaderT () | |
| Default constructor. | |
| ~FileReaderT () | |
| Default destructor. | |
| virtual void | open (std::istream &s) |
| Opens the given stream for reading. | |
| virtual void | open (const std::string &f) |
| Opens a stream to the given filename for reading. | |
| virtual bool | hasNext () |
| Checks whether there are more items left in the stream. | |
| virtual void | reset () |
| Resets the stream to the beginning. | |
| T * | getNext () |
| Returns a pointer to the next item in the file. | |
Template class that supports reading lines of a file to object instances using a fromString(char* line) method (e.g.
YARP Bottles).
Definition at line 37 of file FileReaderT.h.
|
inline |
Default constructor.
Definition at line 78 of file FileReaderT.h.
|
inline |
Default destructor.
Definition at line 86 of file FileReaderT.h.
|
inline |
Returns a pointer to the next item in the file.
Note that the caller takes responsibility for cleaning the memory space associated with the pointer.
| std::runtime_error | no open stream |
| std::runtime_error | end of stream |
Definition at line 148 of file FileReaderT.h.
|
inlinevirtual |
Checks whether there are more items left in the stream.
| std::runtime_error | no open stream |
Definition at line 123 of file FileReaderT.h.
|
inlinevirtual |
Opens a stream to the given filename for reading.
| f | the filename |
Definition at line 105 of file FileReaderT.h.
|
inlinevirtual |
Opens the given stream for reading.
| s | the input stream |
Definition at line 95 of file FileReaderT.h.
|
inlinevirtual |
Resets the stream to the beginning.
Note that this may not be possible for specific combinations of streams (e.g. stdin) and platforms.
Definition at line 134 of file FileReaderT.h.