-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDisplyText.C
More file actions
48 lines (41 loc) · 1.75 KB
/
DisplyText.C
File metadata and controls
48 lines (41 loc) · 1.75 KB
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
#include <iostream>
#include <iomanip>
#include <string>
#include "TString.h"
#include "BoolToString.C"
using namespace std;
void DisplyText(const string &Varname, const int &Space, const string &Var)
{
string VarnameToDisply = Varname + ":";
string VarToDisply = Var;
int VarnameToDisplyLength = Varname.size();
cout << "\033[33m" << VarnameToDisply << "\033[0m" <<std::setw(Space - VarnameToDisplyLength) << VarToDisply << "\n";
}
void DisplyText(const string &Varname, const int &Space, const int &Var)
{
string VarnameToDisply = Varname + ":";
string VarToDisply = to_string(Var);
int VarnameToDisplyLength = Varname.size();
cout << "\033[33m" << VarnameToDisply << "\033[0m" <<std::setw(Space - VarnameToDisplyLength) << VarToDisply << "\n";
}
void DisplyText(const string &Varname, const int &Space, const double &Var)
{
string VarnameToDisply = Varname + ":";
string VarToDisply = to_string(Var);
int VarnameToDisplyLength = Varname.size();
cout << "\033[33m" << VarnameToDisply << "\033[0m" <<std::setw(Space - VarnameToDisplyLength) << VarToDisply << "\n";
}
void DisplyText(const string &Varname, const int &Space, const bool &Var)
{
string VarnameToDisply = Varname + ":";
string VarToDisply = BoolToString(Var);
int VarnameToDisplyLength = Varname.size();
cout << "\033[33m" << VarnameToDisply << "\033[0m" <<std::setw(Space - VarnameToDisplyLength) << VarToDisply << "\n";
}
void DisplyText(const string &Varname, const int &Space, const TString &Var)
{
string VarnameToDisply = Varname + ":";
string VarToDisply = Var.Data();
int VarnameToDisplyLength = Varname.size();
cout << "\033[33m" << VarnameToDisply << "\033[0m" <<std::setw(Space - VarnameToDisplyLength) << VarToDisply << "\n";
}