forked from bhamon/gpuPlotGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlotsFile.h
41 lines (30 loc) · 1.07 KB
/
PlotsFile.h
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
34
35
36
37
38
39
40
41
/*
GPU plot generator for Burst coin.
Author: Cryo
Bitcoin: 138gMBhCrNkbaiTCmUhP9HLU9xwn5QKZgD
Burst: BURST-YA29-QCEW-QXC3-BKXDL
Based on the code of the official miner and dcct's plotgen.
*/
#ifndef CRYO_GPU_PLOT_GENERATOR_PLOTS_FILE_H
#define CRYO_GPU_PLOT_GENERATOR_PLOTS_FILE_H
#include <string>
#include <fstream>
#include <exception>
namespace cryo {
namespace gpuPlotGenerator {
class PlotsFile {
private:
std::fstream m_stream;
public:
PlotsFile(const std::string& p_path, bool p_truncate = false) throw (std::exception);
PlotsFile(const PlotsFile& p_other) = delete;
virtual ~PlotsFile() throw ();
PlotsFile& operator=(const PlotsFile& p_other) = delete;
void seek(std::streamoff p_offset, std::ios::seekdir p_direction);
void read(unsigned char* p_buffer, std::streamsize p_size) throw (std::exception);
void write(const unsigned char* p_buffer, std::streamsize p_size) throw (std::exception);
void flush() throw (std::exception);
static void preallocate(const std::string& p_path, unsigned long long p_size) throw (std::exception);
};
}}
#endif