-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBinaryStdOut.h
More file actions
42 lines (31 loc) · 752 Bytes
/
BinaryStdOut.h
File metadata and controls
42 lines (31 loc) · 752 Bytes
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
/*************************************************************************
> File Name: BinaryStdOut.h
> Author:
> Mail:
> Created Time: Wed 14 Jan 2015 09:12:17 PM CST
************************************************************************/
#ifndef _BINARYSTDOUT_H
#define _BINARYSTDOUT_H
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
class BinaryStdOut
{
char buffer;
int N;
ofstream fout;
void clearBuffer();
void writeBit(bool bit);
void writeChar(char ch);
public:
BinaryStdOut(){};
BinaryStdOut(string filename);
bool open(string filename);
void write(bool bit);
void write(char ch);
void write(int i);
void flush();
void close();
};
#endif