![]() |
PUMA Library Reference Manual
|
#include <Puma/FileSource.h>
Inheritance diagram for Puma::FileSource:File wrapper implementing the Source interface.
Public Member Functions | |
| FileSource (const char *path, ErrorSink *err=(ErrorSink *) 0) | |
| Construct a new file wrapper. | |
| ~FileSource () | |
| Destroy the file wrapper. | |
| virtual int | read (char *dest, int n) |
| Read n bytes from the file into the given string. | |
Public Member Functions inherited from Puma::FdSource | |
| FdSource () | |
| Construct a new file descriptor wrapper with invalid file descriptor. | |
| FdSource (int fdesc) | |
| Construct a new wrapper for the given file descriptor. | |
| virtual | ~FdSource () |
| Destroy the wrapper. | |
| void | fd (int fdesc) |
| Set the wrapped file descriptor. | |
| int | fd () |
| Get the wrapped file descriptor. | |
| int | size () |
| Get the size of the file. | |
Public Member Functions inherited from Puma::Source | |
| Source () | |
| Constructs an empty source object. | |
| virtual | ~Source () |
| Destroys the source object. | |
Construct a new file wrapper.
Opens the given file in read-only mode.
| path | The path to the file. |
| err | Optional error stream. |
|
inline |
Destroy the file wrapper.
Closes the file opened in the constructor.
|
inlinevirtual |
Read n bytes from the file into the given string.
| dest | The string used as buffer for the bytes read. |
| n | The number of bytes to read. |
Reimplemented from Puma::FdSource.