-
Notifications
You must be signed in to change notification settings - Fork 0
/
SWFWriter.h
48 lines (37 loc) · 967 Bytes
/
SWFWriter.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
42
43
44
45
46
47
/*
* File: SWFWriter.h
* Author: brucewang
*
* Created on October 27, 2009, 1:37 AM
*/
#ifndef _SWFWRITER_H
#define _SWFWRITER_H
#include "types.h"
class SWFWriter {
#define SWFWRITER_BUFSIZE 1048576 // 1mb
byte* mBuffer;
int mBytePos;
int mBitPos;
bool pushByte(byte b);
bool pushBit(bool b);
public:
SWFWriter();
virtual ~SWFWriter();
int GetPosition(){ return mBytePos; }
int GetBitPosition(){ return mBitPos; }
const byte * GetBuffer(){ return mBuffer; }
void WriteByte(byte data);
void WriteUI8(byte data);
void WriteUI8(byte* data, int n);
void WriteSI8(sbyte data);
void WriteUI16(UInt16 data);
void WriteSI16(Int16 data);
void WriteUI32(UInt32 data);
void WriteSI32(UInt32 data);
void WriteSTRING(const szstring data);
void WriteUB(UInt32 data, int nBits);
void WriteSB(Int32 data, int nBits);
bool SaveFile(char* file);
private:
};
#endif /* _SWFWRITER_H */