From a9ba68d33abcadfbed7aa64aecd5e5b221246eff Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sun, 6 Apr 2014 21:56:55 +0100 Subject: Added command parser --- parse.cpp | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ parse.h | 3 ++ 2 files changed, 115 insertions(+) create mode 100644 parse.cpp create mode 100644 parse.h diff --git a/parse.cpp b/parse.cpp new file mode 100644 index 0000000..a0f0300 --- /dev/null +++ b/parse.cpp @@ -0,0 +1,112 @@ +#include +#include +#include +#include +#include +#include +#include +#include +void pish_parse(const string& str) +{ + stringstream ss(str); + string cmd; + ss>>cmd; + vector args; + while(ss) + { + string arg; + ss >> arg; + args.push_back(arg); + } + string argstr; + for(int i=0;i +using namespace std; +void pish_parse(const string& str); -- cgit v1.1