]> git.donarmstrong.com Git - mothur.git/blobdiff - commandfactory.hpp
added modify names parameter to set.dir
[mothur.git] / commandfactory.hpp
index 9bbba573057e23c820e24a5c1d6d8c62e7fc5d5b..36e8f462b146fc7846ee6cf9ead1eb42e9757a36 100644 (file)
@@ -1,25 +1,62 @@
-#ifndef COMMANDFACTORY_HPP
-#define COMMANDFACTORY_HPP
-
-/*
- *  commandfactory.h
- *  
- *
- *  Created by Pat Schloss on 10/25/08.
- *  Copyright 2008 Patrick D. Schloss. All rights reserved.
- *
- */
-
-class Command;
-
-class CommandFactory {
-public:
-       CommandFactory();
-       ~CommandFactory();
-       Command* getCommand(string);
-private:
-       Command* command;
-
-};
-
-#endif
+#ifndef COMMANDFACTORY_HPP\r
+#define COMMANDFACTORY_HPP\r
+\r
+/*\r
+ *  commandfactory.h\r
+ *  \r
+ *\r
+ *  Created by Pat Schloss on 10/25/08.\r
+ *  Copyright 2008 Patrick D. Schloss. All rights reserved.\r
+ *\r
+ */\r
+\r
+#include "mothur.h"\r
+#include "mothurout.h"\r
+#include "currentfile.h"\r
+\r
+class Command;\r
+\r
+class CommandFactory {\r
+public:\r
+       static CommandFactory* getInstance();\r
+       Command* getCommand(string, string, string);\r
+       Command* getCommand(string, string);\r
+       Command* getCommand(string);\r
+       //Command* getCommand();\r
+       bool isValidCommand(string);\r
+       bool isValidCommand(string, string);\r
+       void printCommands(ostream&);\r
+    void printCommandsCategories(ostream&);\r
+       void setOutputDirectory(string o)               {       outputDir = o;  m->setOutputDir(o);     }\r
+       void setInputDirectory(string i)                {       inputDir = i;           }\r
+       void setLogfileName(string n, bool a)   {       logFileName = n;  append = a;           }\r
+       string getLogfileName()                                 {       return logFileName;     }\r
+       bool getAppend()                                                {       return append;                  }\r
+       string getOutputDir()                                   {       return outputDir;               }\r
+       bool MPIEnabled(string);\r
+       map<string, string> getListCommands()   {       return commands;                }\r
+       \r
+private:\r
+       Command* command;\r
+       Command* shellcommand;\r
+       Command* pipecommand;\r
+       \r
+       MothurOut* m;\r
+       CurrentFile* currentFile;\r
+       \r
+       map<string, string> commands;\r
+       map<string, string>::iterator it;\r
+       string outputDir, inputDir, logFileName;\r
+       bool append;\r
+       \r
+    int checkForRedirects(string);\r
+    \r
+       static CommandFactory* _uniqueInstance;\r
+       CommandFactory( const CommandFactory& ); // Disable copy constructor\r
+       void operator=( const CommandFactory& ); // Disable assignment operator\r
+       CommandFactory();\r
+       ~CommandFactory();\r
+\r
+};\r
+\r
+#endif\r