-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathchunkio.h
More file actions
55 lines (46 loc) · 1.14 KB
/
chunkio.h
File metadata and controls
55 lines (46 loc) · 1.14 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <fstream>
#include <string>
namespace chunkio {
using namespace std;
string strchunk (int l);
class ofchunk {
private:
ofstream ofs;
int remainingchunklen;
public:
ofchunk (const char * fname, ios_base::openmode mode = ios_base::out);
bool startchunk (const char * chunkname, int len);
bool endchunk (void);
bool isok (void);
bool writeLONG (int l);
bool writeWORD (int l);
bool writeBYTE (int l);
bool writeBYTES (const char *p, int l);
void close (void);
bool operator ! () const;
operator void * () const;
~ofchunk (void);
};
class ifchunk {
private:
ifstream ifs;
int remainingchunklen;
public:
ifchunk (const char * fname, ios_base::openmode mode = ios_base::out);
bool isok (void);
bool operator ! () const;
operator void * () const;
int getnextchunk (void);
int get_remchunklen (void);
bool readLONG (int &l);
bool readWORD (int &l);
bool readBYTE (int &l);
void close (void);
~ifchunk (void);
// bool startchunk (const char * chunkname, int len);
// bool endchunk (void);
// bool isok (void);
// bool writeLONG (int l);
// bool writeBYTES (const char *p, int l);
};
}