libzipper 1.0.1
|
FileWrter is a file-based implementation of the Writer interface. More...
#include <zipper.hh>
Public Member Functions | |
FileWriter (const std::string &filename, mode_t createPermissions=0664, const timeval &modTime=s_now) | |
FileWriter (const std::string &filename, int fd, bool closeFd) | |
virtual | ~FileWriter () |
FileWriter dtor. | |
virtual zsize_t | getSize () const |
Inherited from Writer. | |
virtual void | writeData (zsize_t offset, zsize_t bytes, const uint8_t *data) |
Inherited from Writer. |
FileWrter is a file-based implementation of the Writer interface.
zipper::FileWriter::FileWriter | ( | const std::string & | filename, |
mode_t | createPermissions = 0664 , |
||
const timeval & | modTime = s_now |
||
) |
Write data to the supplied file. If the file already exists, it will be truncated. If the file does not exist, it will be created with the given permissions.
filename | The file to open for writing. |
createPermissions | The permissions set on the file if it is to be created. |
modTime | Set a specific modification time on the created file. If the special s_now value is provided, the current time will be used. |
zipper::FileWriter::FileWriter | ( | const std::string & | filename, |
int | fd, | ||
bool | closeFd | ||
) |
Write data to the supplied file.
filename | The filename reported in any exception error messages. This name is arbitary, and does not need to be related to fd. |
fd | The descriptor to write data to. The descriptor must be open for writing in blocking mode. |
closeFd | If true, fd will be closed by this object when it is no longer needed. |