2 * clearmemorycommand.cpp
5 * Created by westcott on 7/6/11.
6 * Copyright 2011 Schloss Lab. All rights reserved.
10 #include "clearmemorycommand.h"
11 #include "referencedb.h"
13 //**********************************************************************************************************************
14 vector<string> ClearMemoryCommand::setParameters(){
16 vector<string> myArray;
20 m->errorOut(e, "ClearMemoryCommand", "setParameters");
24 //**********************************************************************************************************************
25 string ClearMemoryCommand::getOutputFileNameTag(string type, string inputName=""){
27 string outputFileName = "";
28 map<string, vector<string> >::iterator it;
30 //is this a type this command creates
31 it = outputTypes.find(type);
32 if (it == outputTypes.end()) { m->mothurOut("[ERROR]: this command doesn't create a " + type + " output file.\n"); }
34 m->mothurOut("[ERROR]: No definition for type " + type + " output file tag.\n"); m->control_pressed = true;
36 return outputFileName;
39 m->errorOut(e, "ClearMemoryCommand", "getOutputFileNameTag");
43 //**********************************************************************************************************************
44 string ClearMemoryCommand::getHelpString(){
46 string helpString = "";
47 helpString += "The clear.memory command removes saved reference data from memory.\n";
48 helpString += "The clear.memory command should be in the following format: clear.memory().\n";
52 m->errorOut(e, "ClearMemoryCommand", "getHelpString");
56 //**********************************************************************************************************************
58 ClearMemoryCommand::ClearMemoryCommand(string option) {
60 abort = false; calledHelp = false;
62 //allow user to run help
63 if(option == "help") { help(); abort = true; calledHelp = true; }
64 else if(option == "citation") { citation(); abort = true; calledHelp = true;}
67 m->errorOut(e, "ClearMemoryCommand", "ClearMemoryCommand");
72 //**********************************************************************************************************************
74 int ClearMemoryCommand::execute(){
77 if (abort == true) { if (calledHelp) { return 0; } return 2; }
79 ReferenceDB* rdb = ReferenceDB::getInstance();
85 m->errorOut(e, "ClearMemoryCommand", "execute");
89 //**********************************************************************************************************************/