forked from 20020001-UET/dsa-decision-tree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConsole.h
45 lines (35 loc) · 738 Bytes
/
Console.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
/*
* This file is part of dsa-decision-tree
*
* Developed for the DSA UET course.
* This project was developed by Ba Luong and Gia Linh.
*/
#pragma once
#ifndef CONSOLE_H
#define CONSOLE_H
#include <iostream>
#include <string>
#include <utility>
using namespace std;
class Console
{
private:
string name;
bool enable;
public:
Console(string _name = "", bool _enable = true);
~Console();
bool isEnable();
void setEnable(bool _enable);
template <typename... Args>
constexpr void log(ostream &os, Args &&...args) noexcept
{
if (enable)
{
os << "[" << name << "] ";
((os << forward<Args>(args)), ...);
os << "\n";
}
}
};
#endif