9 #ifndef CFileOutputStream_H
10 #define CFileOutputStream_H
43 const std::string &fileName,
56 bool open(
const std::string &fileName,
bool append =
false );
65 bool is_open() {
return fileOpenCorrectly(); }
This CStream derived class allow using a file as a write-only, binary stream.
size_t Read(void *Buffer, size_t Count) MRPT_OVERRIDE
Introduces a pure virtual method responsible for reading from the stream.
CFileOutputStream(const std::string &fileName, bool append=false)
Constructor.
CFileOutputStream()
Default constructor.
virtual ~CFileOutputStream()
Destructor.
uint64_t getTotalBytesCount() MRPT_OVERRIDE
Method for getting the total number of bytes writen to buffer.
bool fileOpenCorrectly()
Returns true if the file was open without errors.
void close()
Close the stream.
std::ofstream m_of
The actual output file stream.
uint64_t Seek(uint64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning) MRPT_OVERRIDE
Introduces a pure virtual method for moving to a specified position in the streamed resource.
bool is_open()
Returns true if the file was open without errors.
bool open(const std::string &fileName, bool append=false)
Open the given file for write.
size_t Write(const void *Buffer, size_t Count) MRPT_OVERRIDE
Introduces a pure virtual method responsible for writing to the stream.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
TSeekOrigin
Used in CStream::Seek.
The base class of classes that cannot be copied: compile-time errors will be issued on any copy opera...
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.