mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 06:05:58 -06:00
28 lines
530 B
C++
28 lines
530 B
C++
#ifndef _Core_Huge_h_
|
|
#define _Core_Huge_h_
|
|
|
|
class Huge {
|
|
public:
|
|
enum { CHUNK = 1024 * 1024 };
|
|
|
|
private:
|
|
struct Block {
|
|
byte data[CHUNK];
|
|
};
|
|
|
|
Array<Block> data;
|
|
size_t size;
|
|
|
|
public:
|
|
byte *AddChunk();
|
|
void Finish(int last_chunk_size);
|
|
|
|
size_t GetSize() const { return size; }
|
|
void Get(void *t, size_t pos, size_t sz) const;
|
|
void Get(void *t) { Get(t, 0, GetSize()); }
|
|
String Get() const;
|
|
|
|
Huge();
|
|
};
|
|
|
|
#endif
|