5 * Created by Thomas Ryabin on 1/30/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "getlinecommand.h"
12 //**********************************************************************************************************************
13 GetlineCommand::GetlineCommand(string option){
15 globaldata = GlobalData::getInstance();
18 //allow user to run help
19 if(option == "help") { help(); abort = true; }
22 if (option != "") { cout << "There are no valid parameters for the get.line command." << endl; abort = true; }
24 if ((globaldata->getListFile() == "") && (globaldata->getRabundFile() == "") && (globaldata->getSabundFile() == "")) { cout << "You must read a list, sabund or rabund before you can use the get.line command." << endl; abort = true; }
29 cout << "Standard Error: " << e.what() << " has occurred in the GetlineCommand class Function GetlineCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
33 cout << "An unknown error has occurred in the GetlineCommand class function GetlineCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
38 //**********************************************************************************************************************
40 void GetlineCommand::help(){
42 cout << "The get.line command can only be executed after a successful read.otu command." << "\n";
43 cout << "You may not use any parameters with the get.line command." << "\n";
44 cout << "The get.line command should be in the following format: " << "\n";
45 cout << "get.line()" << "\n";
46 cout << "Example get.line()." << "\n";
49 cout << "Standard Error: " << e.what() << " has occurred in the GetlineCommand class Function help. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
53 cout << "An unknown error has occurred in the GetlineCommand class function help. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
58 //**********************************************************************************************************************
60 GetlineCommand::~GetlineCommand(){
63 //**********************************************************************************************************************
65 int GetlineCommand::execute(){
68 if (abort == true) { return 0; }
71 openInputFile(globaldata->inputFileName, in);
91 cout << "Standard Error: " << e.what() << " has occurred in the GetlineCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
95 cout << "An unknown error has occurred in the GetlineCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";