25 #ifndef COMMON_READFILE_H 26 #define COMMON_READFILE_H 30 #include <boost/noncopyable.hpp> 68 size_t read(
void *dataPtr,
size_t dataSize);
77 #endif // COMMON_READFILE_H size_t pos() const
Obtains the current value of the stream position indicator of the stream.
A class holding an UTF-8 string.
A simple streaming file reading class.
size_t _size
The file's size.
bool eos() const
Returns true if a read failed because the stream has been reached.
size_t seek(ptrdiff_t offset, Origin whence=kOriginBegin)
Sets the stream position indicator for the stream.
Origin
The position a seeking offset takes as a base.
bool open(const UString &fileName)
Try to open the file with the given fileName.
size_t read(void *dataPtr, size_t dataSize)
Read data from the stream.
Low-level type definitions to handle fixed width types portably.
Basic reading stream interfaces.
std::FILE * _handle
The actual file handle.
size_t size() const
Obtains the total size of the stream, measured in bytes.
bool isOpen() const
Checks if the object opened a file successfully.
Seek from the begin of the stream.
void close()
Close the file, if open.
Interface for a seekable & readable data stream.