mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-07 08:05:23 +13:00
made changes in repo
hg-commit-id: 1145e088ee27
This commit is contained in:
parent
21caa525cc
commit
4d0797bc3a
30 changed files with 1748 additions and 0 deletions
54
music/pokeredmusicdisasm/Console.cpp
Normal file
54
music/pokeredmusicdisasm/Console.cpp
Normal file
|
|
@ -0,0 +1,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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue