]> git.donarmstrong.com Git - mothur.git/blob - command.hpp
added load.logfile command. changed summary.single output for subsample=t.
[mothur.git] / command.hpp
1 #ifndef COMMAND_HPP
2 #define COMMAND_HPP
3 //test2
4 /*
5  *  command.h
6  *  
7  *
8  *  Created by Pat Schloss on 10/23/08.
9  *  Copyright 2008 Patrick D. Schloss. All rights reserved.
10  *
11  */
12
13 /*This class is a parent to all the command classes.  */
14
15
16 #include "mothur.h"
17 #include "optionparser.h"
18 #include "validparameter.h"
19 #include "mothurout.h"
20 #include "commandparameter.h"
21
22
23 class Command {
24         
25         public:
26                 Command() {  m = MothurOut::getInstance();   } 
27                 
28                 //needed by gui
29                 virtual string getCommandName() = 0;
30                 virtual string getCommandCategory() = 0;
31                 virtual string getHelpString() = 0;
32                 virtual string getCitation() = 0;
33                 virtual string getDescription() = 0;
34                 
35                 virtual map<string, vector<string> > getOutputFiles() { return outputTypes; }
36         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.
37                 virtual vector<string> setParameters() = 0; //to fill parameters
38                 virtual vector<CommandParameter> getParameters() { return parameters; }
39         
40                 virtual int execute() = 0;
41                 virtual void help() = 0;
42                 void citation() { m->mothurOutEndLine(); m->mothurOut(getCitation()); m->mothurOutEndLine(); }
43                 virtual ~Command() { }
44         
45         protected:
46                 MothurOut* m;
47                 bool calledHelp;
48                         
49                 map<string, vector<string> > outputTypes;
50                 vector<CommandParameter> parameters;
51         
52                 map<string, vector<string> >::iterator itTypes;
53 };
54
55 #endif