#include <mrpt/utils/CFileOutputStream.h>
Public Member Functions | |
CFileOutputStream (const std::string &fileName, bool append=false) | |
Constructor. | |
CFileOutputStream () | |
Default constructor. | |
bool | open (const std::string &fileName, bool append=false) |
Open the given file for write. | |
void | close () |
Close the stream. | |
virtual | ~CFileOutputStream () |
Destructor. | |
bool | fileOpenCorrectly () |
Says if file was open successfully or not. | |
size_t | Seek (long Offset, CStream::TSeekOrigin Origin=sFromBeginning) |
Method for moving to a specified position in the streamed resource. | |
size_t | getTotalBytesCount () |
Method for getting the total number of bytes writen to buffer. | |
size_t | getPosition () |
Method for getting the current cursor position, where 0 is the first byte and TotalBytesCount-1 the last one. | |
Protected Member Functions | |
size_t | Read (void *Buffer, size_t Count) |
Method responsible for reading from the stream. | |
size_t | Write (const void *Buffer, size_t Count) |
Method responsible for writing to the stream. | |
Private Attributes | |
std::ofstream | m_of |
The actual output file stream. |
Definition at line 46 of file CFileOutputStream.h.
mrpt::utils::CFileOutputStream::CFileOutputStream | ( | const std::string & | fileName, | |
bool | append = false | |||
) |
Constructor.
fileName | The file to be open in this stream | |
append | If set to true, the file will be opened for writing and the current cursor position set at the end of the file. Otherwise, previous contents will be lost. |
std::exception | if the file cannot be opened. |
mrpt::utils::CFileOutputStream::CFileOutputStream | ( | ) |
Default constructor.
virtual mrpt::utils::CFileOutputStream::~CFileOutputStream | ( | ) | [virtual] |
Destructor.
void mrpt::utils::CFileOutputStream::close | ( | ) |
Close the stream.
bool mrpt::utils::CFileOutputStream::fileOpenCorrectly | ( | ) |
Says if file was open successfully or not.
size_t mrpt::utils::CFileOutputStream::getPosition | ( | ) | [virtual] |
Method for getting the current cursor position, where 0 is the first byte and TotalBytesCount-1 the last one.
Implements mrpt::utils::CStream.
size_t mrpt::utils::CFileOutputStream::getTotalBytesCount | ( | ) | [virtual] |
bool mrpt::utils::CFileOutputStream::open | ( | const std::string & | fileName, | |
bool | append = false | |||
) |
Open the given file for write.
fileName | The file to be open in this stream | |
append | If set to true, the file will be opened for writing and the current cursor position set at the end of the file. Otherwise, previous contents will be lost. |
size_t mrpt::utils::CFileOutputStream::Read | ( | void * | Buffer, | |
size_t | Count | |||
) | [protected, virtual] |
size_t mrpt::utils::CFileOutputStream::Seek | ( | long | Offset, | |
CStream::TSeekOrigin | Origin = sFromBeginning | |||
) | [virtual] |
Method for moving to a specified position in the streamed resource.
See documentation of CStream::Seek
Implements mrpt::utils::CStream.
size_t mrpt::utils::CFileOutputStream::Write | ( | const void * | Buffer, | |
size_t | Count | |||
) | [protected, virtual] |
Method responsible for writing to the stream.
Write attempts to write up to Count bytes to Buffer, and returns the number of bytes actually written.
Implements mrpt::utils::CStream.
std::ofstream mrpt::utils::CFileOutputStream::m_of [private] |
Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN:exported at Mon Jan 12 13:00:16 UTC 2009 |