]> git.donarmstrong.com Git - mothur.git/blob - readotucommand.cpp
130ecd0f08a540239e0cbbbf1862611528e1d8a8
[mothur.git] / readotucommand.cpp
1 /*
2  *  readotu.cpp
3  *  Mothur
4  *
5  *  Created by Sarah Westcott on 1/20/09.
6  *  Copyright 2009 Schloss Lab UMASS AMherst. All rights reserved.
7  *
8  */
9
10 #include "readotucommand.h"
11
12 //**********************************************************************************************************************
13 ReadOtuCommand::ReadOtuCommand(){
14         try {
15                 globaldata = GlobalData::getInstance();
16                 filename = globaldata->inputFileName;
17                 read = new ReadPhilFile(filename);
18         }
19         catch(exception& e) {
20                 cout << "Standard Error: " << e.what() << " has occurred in the ReadOtuCommand class Function ReadOtuCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
21                 exit(1);
22         }
23         catch(...) {
24                 cout << "An unknown error has occurred in the ReadOtuCommand class function ReadOtuCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
25                 exit(1);
26         }
27 }
28
29 //**********************************************************************************************************************
30
31 ReadOtuCommand::~ReadOtuCommand(){
32         delete read;
33 }
34
35 //**********************************************************************************************************************
36
37 int ReadOtuCommand::execute(){
38         try {
39                 read->read(&*globaldata); 
40                 return 0;
41         }
42         catch(exception& e) {
43                 cout << "Standard Error: " << e.what() << " has occurred in the ReadOtuCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
44                 exit(1);
45         }
46         catch(...) {
47                 cout << "An unknown error has occurred in the ReadOtuCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
48                 exit(1);
49         }
50 }
51 //**********************************************************************************************************************