-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFileWriter.h
51 lines (41 loc) · 1.63 KB
/
FileWriter.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
/******************************************************************************
* *
* Program : FileLogger *
* *
* Date : 15 / 04 / 2021 *
* *
* Programmer : Nikita Seliverstov (nikselko) *
* *
* *
******************************************************************************/
#pragma once
#include "includes.h"
#include <cstdio>
#include <string>
class FileWriter
{
public:
FileWriter(string file_name);
~FileWriter();
bool is_open();
FileWriter& write(const std::string& m_string);
FileWriter& write(const char* m_charp);
FileWriter& write(const char& m_char);
FileWriter& write(const int& m_int);
FileWriter& write(const double& m_double);
FileWriter& write(const bool& m_bool);
FileWriter& then(const std::string& m_string);
FileWriter& then(const char* m_charp);
FileWriter& then(const char& m_char);
FileWriter& then(const int& m_int);
FileWriter& then(const double& m_double);
FileWriter& then(const bool& m_bool);
FileWriter& newline();
int lines();
int size();
private:
FILE* file_pointer;
string file_name;
int characters_amount;
int new_line_calls;
};