-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrinter.cpp
More file actions
28 lines (24 loc) · 852 Bytes
/
Printer.cpp
File metadata and controls
28 lines (24 loc) · 852 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
//File: Printer.cpp
//Name: Murtaza & Yash
// ------------------------------------
#include "tools.hpp"
#include "Printer.hpp"
Printer Printer::instance;
//------------------------------------------------------------------------
// Printing function where it prints messages to file and terminal--------
//------------------------------------------------------------------------
void Printer::write(const string& message , ostream& out) {
out<<message;
instance.file << message;
}
void Printer::writeln(const string& message , ostream& out) {
out<<message<<'\n';
instance.file << message<<'\n';
}
//-------------------------------------------------
// Destructor that closes test print file --------
//-------------------------------------------------
Printer::~Printer()
{
instance.file.close();
}