7 #include "athena/IStreamReader.hpp" 16 FileReader(
const std::string& filename, atInt32 cacheSize = (32 * 1024),
bool globalErr=
true);
17 FileReader(
const std::wstring& filename, atInt32 cacheSize = (32 * 1024),
bool globalErr=
true);
20 inline std::string filename()
const 23 return utility::wideToUtf8(m_filename);
29 inline std::wstring wfilename()
const 34 return utility::utf8ToWide(m_filename);
40 inline bool isOpen()
const 41 {
return m_fileHandle != NULL;}
43 void seek(atInt64 pos, SeekOrigin origin = SeekOrigin::Current);
48 void setCacheSize(
const atInt32 blockSize);
49 FILE* _fileHandle() {
return m_fileHandle;}
52 std::wstring m_filename;
54 std::string m_filename;
57 std::unique_ptr<atUint8[]> m_cacheData;
66 #ifndef FILEREADER_BASE 67 #define FILEREADER_BASE() \ 69 typedef athena::io::FileReader base 71 #endif // FILEREADER_BASE 73 #endif // FILESTREAM_HPP atUint64 position() const
Returns the current position in the stream.
atUint64 length() const
Returns the length of the file.
The IStreamReader class defines a basic API for reading from streams, Implementors are provided with ...
void seek(atInt64 pos, SeekOrigin origin=SeekOrigin::Current)
Sets the buffers position relative to the specified position. It seeks relative to the current posit...
atUint64 readUBytesToBuf(void *buf, atUint64 len)
Attempts to read a fixed length of data into a pre-allocated buffer, this function is client defined ...