-
Notifications
You must be signed in to change notification settings - Fork 0
/
out.h
53 lines (45 loc) · 1.03 KB
/
out.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
48
49
50
51
52
53
/*
* =====================================================================================
*
* Filename: out.h
*
* Description:
*
* Version: 1.0
* Created: 04/28/2020 10:04:07
* Revision: none
* Compiler: gcc
*
* Author: Andy (), andy_y_li@163.com
* Company:
*
* =====================================================================================
*/
#ifndef __OUT_H
#define __OUT_H
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
#define FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
class Out {
int handle;
bool noisy;
public:
Out(const char *filename);
~Out();
void setHandle(int fd);
int setHandle(const char *filename);
int getHandle();
void on();
void off();
int print(const char *str);
int get(char *destr);
Out &operator<<(const string &s);
Out &operator<<(const char &c);
};
#endif // #ifndef __OUT_H