diff options
| author | KuroiIeWa5Da <tyuki@adu.me> | 2012-01-23 01:41:05 -0600 |
|---|---|---|
| committer | KuroiIeWa5Da <tyuki@adu.me> | 2012-01-23 01:41:05 -0600 |
| commit | 4d0797bc3a6ae0ea4b44e8b6463339d662f5d669 (patch) | |
| tree | 03b824a1bb511bbb8c57ea378c1d27ea04c27ef7 /music/pokeredmusicdisasm/Console.cpp | |
| parent | Finished PkmnHealed music data - all 3 channels (diff) | |
| download | pokeyellow-4d0797bc3a6ae0ea4b44e8b6463339d662f5d669.tar.gz pokeyellow-4d0797bc3a6ae0ea4b44e8b6463339d662f5d669.tar.xz pokeyellow-4d0797bc3a6ae0ea4b44e8b6463339d662f5d669.zip | |
made changes in repo
hg-commit-id: 1145e088ee27
Diffstat (limited to 'music/pokeredmusicdisasm/Console.cpp')
| -rw-r--r-- | music/pokeredmusicdisasm/Console.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/music/pokeredmusicdisasm/Console.cpp b/music/pokeredmusicdisasm/Console.cpp new file mode 100644 index 00000000..85623210 --- /dev/null +++ b/music/pokeredmusicdisasm/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;
+}
|
