-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileWriter.hpp
More file actions
31 lines (24 loc) · 767 Bytes
/
FileWriter.hpp
File metadata and controls
31 lines (24 loc) · 767 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
/*******************************************************************************
* Rohan data serialization library.
*
* © 2016—2024, Sauron
******************************************************************************/
#ifndef __ROHAN_FILEWRITER_HPP
#define __ROHAN_FILEWRITER_HPP
#include <unix++/File.hpp>
#include "Writer.hpp"
namespace rohan {
/**/
class FileWriter : public Writer {
public:
/** Open a file for writing **/
explicit FileWriter(const char * filename, int flags=O_WRONLY|O_CREAT|O_TRUNC);
/** Write a portion of data **/
void write(const void * from, size_t length) override;
/** Direct access to the underlying file **/
upp::File &getFile() { return file; }
private:
upp::File file;
};
}
#endif