blob: 9bac7b1f3dcf8755b55f7e8f836f03dd3036d0a6 (
plain)
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
54
|
#include "Console.h"
using namespace std;
// Basic
void Console::Get(char* value)
{
cin >> value;
}
void Console::Get(string& value)
{
cin >> value;
}
void Console::Print(const char* value)
{
cout << value;
}
void Console::Error(const char* value)
{
cerr << value;
}
// Upper-Basic
void Console::PrintLn(const char* value)
{
Print(value);
cout << endl;
}
void Console::ErrorLn(const char* value)
{
Error(value);
cerr << endl;
}
// Higher
void Console::Ask(const char* question, char* answer)
{
Print(question);
Get(answer);
}
void Console::Ask(const char* question, string& answer)
{
Print(question);
Get(answer);
}
// Better Error Handling
int Console::atoi_ex(const char* input, bool supress)
{
//int convInp = atoi(input);
//if((supress == false) && (convInp == 0))
// PrintLn("Warning: the converted integer input is 0, this may not be what you intended");
// return convInp;
}
|