X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=command.hpp;h=f5e09042234f1c39ac8010f859e6f69708871dc3;hb=5b72d1cf3fa48730e5bb70d59cced1e43e1fe424;hp=c8dae405fe481a6c468d5e5b1f10f838b59f5763;hpb=74c78f9abd9e733f0c2f812efec97a76632fcbf8;p=mothur.git diff --git a/command.hpp b/command.hpp index c8dae40..f5e0904 100644 --- a/command.hpp +++ b/command.hpp @@ -1,6 +1,6 @@ #ifndef COMMAND_HPP #define COMMAND_HPP - +//test2 /* * command.h * @@ -10,14 +10,46 @@ * */ -/*This class is a parent to all the command classes. It has one pure int execute(). */ +/*This class is a parent to all the command classes. */ #include "mothur.h" +#include "optionparser.h" +#include "validparameter.h" +#include "mothurout.h" +#include "commandparameter.h" + class Command { + public: + Command() { m = MothurOut::getInstance(); } + + //needed by gui + virtual string getCommandName() = 0; + virtual string getCommandCategory() = 0; + virtual string getHelpString() = 0; + virtual string getCitation() = 0; + virtual string getDescription() = 0; + + virtual map > getOutputFiles() { return outputTypes; } + virtual string getOutputFileNameTag(string, string) = 0; //we may not know the complete filename, because some commands use info from the file to create the output file name (ie label). but we do the ending tag which should be enough to find the output file name from a list. Allows for optional passing of the inputFileName for the commands that require its extension. + virtual vector setParameters() = 0; //to fill parameters + virtual vector getParameters() { return parameters; } + virtual int execute() = 0; + virtual void help() = 0; + void citation() { m->mothurOutEndLine(); m->mothurOut(getCitation()); m->mothurOutEndLine(); } + virtual ~Command() { } + + protected: + MothurOut* m; + bool calledHelp; + + map > outputTypes; + vector parameters; + + map >::iterator itTypes; }; #endif