-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileReader.hpp
More file actions
33 lines (26 loc) · 819 Bytes
/
FileReader.hpp
File metadata and controls
33 lines (26 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*******************************************************************************
* Rohan data serialization library.
*
* © 2016—2024, Sauron
******************************************************************************/
#ifndef __ROHAN_FILEREADER_HPP
#define __ROHAN_FILEREADER_HPP
#include <unix++/File.hpp>
#include "Reader.hpp"
namespace rohan {
/**/
class FileReader : public Reader {
public:
/** Open a file for reading **/
explicit FileReader(const char * filename, int flags=O_RDONLY);
/** Read a portion of data **/
size_t read(void * to, size_t length) override;
/** Skip a portion of data **/
size_t skip(size_t length) override;
/** Direct access to the underlying file **/
upp::File &getFile() { return file; }
private:
upp::File file;
};
}
#endif