X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=commandfactory.hpp;h=b1db1921a3a074ae059f8341570aa28477ef0cc0;hp=44e78fd66fa290d9664d773f470249f0600a2836;hb=b206f634aae1b4ce13978d203247fb64757d5482;hpb=84f93a9e670eb7f7e69e0468b9be4c53890c07f2 diff --git a/commandfactory.hpp b/commandfactory.hpp index 44e78fd..b1db192 100644 --- a/commandfactory.hpp +++ b/commandfactory.hpp @@ -12,32 +12,46 @@ #include "mothur.h" #include "mothurout.h" +#include "currentfile.h" class Command; class CommandFactory { public: static CommandFactory* getInstance(); + Command* getCommand(string, string, string); Command* getCommand(string, string); - Command* getCommand(); + Command* getCommand(string); + //Command* getCommand(); bool isValidCommand(string); + bool isValidCommand(string, string); void printCommands(ostream&); - void setOutputDirectory(string o) { outputDir = o; } - void setInputDirectory(string i) { inputDir = i; } + void printCommandsCategories(ostream&); + void setOutputDirectory(string o) { if(m->dirCheck(o) || (o == "")) { outputDir = o; m->setOutputDir(o); } } + void setInputDirectory(string i) { if(m->dirCheck(i) || (i == "")) { inputDir = i; } } void setLogfileName(string n, bool a) { logFileName = n; append = a; } string getLogfileName() { return logFileName; } bool getAppend() { return append; } string getOutputDir() { return outputDir; } + string getInputDir() { return inputDir; } bool MPIEnabled(string); - + map getListCommands() { return commands; } + private: Command* command; + Command* shellcommand; + Command* pipecommand; + MothurOut* m; + CurrentFile* currentFile; + map commands; map::iterator it; string outputDir, inputDir, logFileName; bool append; + int checkForRedirects(string); + static CommandFactory* _uniqueInstance; CommandFactory( const CommandFactory& ); // Disable copy constructor void operator=( const CommandFactory& ); // Disable assignment operator