diff options
| author | KuroiIeWa5Da <tyuki@adu.me> | 2012-01-28 00:38:49 -0600 |
|---|---|---|
| committer | KuroiIeWa5Da <tyuki@adu.me> | 2012-01-28 00:38:49 -0600 |
| commit | 6fd6c7af4675e97f9bcf677edf426b37998f9c13 (patch) | |
| tree | a94f371e9a075e4e49ebcf7c4abe640bbec2f440 /music/pokeredwavptnvis/Console.cpp | |
| parent | update MewBaseStats to use DEX_MEW (diff) | |
| download | pokeyellow-6fd6c7af4675e97f9bcf677edf426b37998f9c13.tar.gz pokeyellow-6fd6c7af4675e97f9bcf677edf426b37998f9c13.tar.xz pokeyellow-6fd6c7af4675e97f9bcf677edf426b37998f9c13.zip | |
big update after strip
hg-commit-id: dcfb20faef4d
Diffstat (limited to 'music/pokeredwavptnvis/Console.cpp')
| -rw-r--r-- | music/pokeredwavptnvis/Console.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/music/pokeredwavptnvis/Console.cpp b/music/pokeredwavptnvis/Console.cpp new file mode 100644 index 00000000..84d5fab1 --- /dev/null +++ b/music/pokeredwavptnvis/Console.cpp @@ -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;
+}
|
