X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=commandoptionparser.cpp;fp=commandoptionparser.cpp;h=0000000000000000000000000000000000000000;hb=4a877efa127e56e81a21f53cfdbbfd3bfbe8c4ff;hp=dfad533c8898ff3d79067d5f16c6869803e21e12;hpb=a6cf29fa4dac0909c7582cb1094151d34093ee76;p=mothur.git diff --git a/commandoptionparser.cpp b/commandoptionparser.cpp deleted file mode 100644 index dfad533..0000000 --- a/commandoptionparser.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * commandoptionparser.cpp - * - * - * Created by Pat Schloss on 10/23/08. - * Copyright 2008 Patrick D. Schloss. All rights reserved. - * - */ - - -#include "commandoptionparser.hpp" - - -//********************************************************************************************************************** -//This Function parses through the command line and pulls out the command then sends the options to the parseGlobalData -CommandOptionParser::CommandOptionParser(string input){ - try { - m = MothurOut::getInstance(); - - int openParen = input.find_first_of('('); - int closeParen = input.find_last_of(')'); - optionString = ""; - commandString = ""; - - if(openParen != -1 && closeParen != -1){ - //gobble extra spaces - int spot = 0; - for (int i = 0; i < input.length(); i++) { if (!(isspace(input[i]))) { spot = i; break; } } - if (spot > openParen) { spot = 0; } - commandString = input.substr(spot, openParen-spot); //commandString contains everything before "(" - optionString = input.substr((openParen+1), (closeParen-openParen-1)); //optionString contains everything between "(" and ")". - } - else if (openParen == -1) { m->mothurOut("[ERROR]: You are missing ("); m->mothurOutEndLine(); } - else if (closeParen == -1) { m->mothurOut("[ERROR]:You are missing )"); m->mothurOutEndLine(); } - } - catch(exception& e) { - m->errorOut(e, "CommandOptionParser", "CommandOptionParser"); - exit(1); - } -} - -//********************************************************************************************************************** - -string CommandOptionParser::getCommandString() { return commandString; } - -//********************************************************************************************************************** - -string CommandOptionParser::getOptionString() { return optionString; } - -//**********************************************************************************************************************