#include "optionparser.h"
/***********************************************************************/
-void OptionParser::parse(string option, map<string, string>& container) {
+
+OptionParser::OptionParser(string option) {
try {
if (option != "") {
-
+
string key, value;
//reads in parameters and values
while((option.find_first_of(',') != -1)) { //while there are parameters
- splitAtComma(value, option);
- splitAtEquals(key, value);
- container[key] = value;
+ splitAtComma(value, option);
+ splitAtEquals(key, value);
+ parameters[key] = value;
}
-
+
//in case there is no comma and to get last parameter after comma
splitAtEquals(key, option);
- container[key] = option;
+ parameters[key] = option;
}
}
catch(exception& e) {
exit(1);
}
}
-/***********************************************************************/
\ No newline at end of file
+
+/***********************************************************************/
+
+map<string, string> OptionParser::getParameters() { return parameters; }
+
+/***********************************************************************/