44 size_t Read(
void* Buffer,
size_t Count)
override;
45 size_t Write(
const void* Buffer,
size_t Count)
override;
This CStream derived class allow using a file as a read/write binary stream, creating it if the file ...
bool is_open()
Returns true if the file was open without errors.
size_t Read(void *Buffer, size_t Count) override
Introduces a pure virtual method responsible for reading from the stream.
bool open(const std::string &fileName, TFileOpenModes mode=fomRead|fomWrite)
Opens the file, returning true on success.
CFileStream()
Constructor.
bool fileOpenCorrectly()
Returns true if the file was open without errors.
size_t Write(const void *Buffer, size_t Count) override
Introduces a pure virtual method responsible for writing to the stream.
CFileStream(const CFileStream &)=delete
uint64_t getPosition() override
Method for getting the current cursor position, where 0 is the first byte and TotalBytesCount-1 the l...
void close()
Closes the file.
virtual ~CFileStream()
Destructor.
std::fstream m_f
The actual input file stream.
bool readLine(std::string &str)
Reads one string line from the file (until a new-line character)
uint64_t getPositionI()
The current Input cursor position, where 0 is the first byte.
uint64_t Seek(uint64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning) override
Method for moving to a specified position in the streamed resource.
uint64_t getTotalBytesCount() override
Method for getting the total number of bytes writen to buffer.
CFileStream & operator=(const CFileStream &)=delete
bool checkEOF()
Will be true if EOF has been already reached.
uint64_t getPositionO()
The current Input cursor position, where 0 is the first byte.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
TSeekOrigin
Used in CStream::Seek.
GLsizei const GLfloat * value
GLsizei const GLchar ** string
int TFileOpenModes
File open modes are used in CFileStream Posible values are:
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
unsigned __int64 uint64_t