ultimatepp/uppsrc/Core/Huge.h
cxl 8f11c6f135 Core: Huge class
git-svn-id: svn://ultimatepp.org/upp/trunk@10006 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2016-07-04 08:02:22 +00:00

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