]> git.donarmstrong.com Git - mothur.git/blob - getgroupcommand.cpp
added mothur.h and fixed includes in many files
[mothur.git] / getgroupcommand.cpp
1 /*
2  *  getgroupcommand.cpp
3  *  Mothur
4  *
5  *  Created by Thomas Ryabin on 2/2/09.
6  *  Copyright 2009 __MyCompanyName__. All rights reserved.
7  *
8  */
9
10 #include "getgroupcommand.h"
11
12
13 GetgroupCommand::GetgroupCommand(){
14         try {
15                 globaldata = GlobalData::getInstance();
16                 groupMap = globaldata->gGroupmap;
17         }
18         catch(exception& e) {
19                 cout << "Standard Error: " << e.what() << " has occurred in the GetgroupCommand class Function GetgroupCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
20                 exit(1);
21         }
22         catch(...) {
23                 cout << "An unknown error has occurred in the GetgroupCommand class function GetgroupCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
24                 exit(1);
25         }       
26                         
27 }
28
29 //**********************************************************************************************************************
30
31 GetgroupCommand::~GetgroupCommand(){
32 }
33
34 //**********************************************************************************************************************
35
36 int GetgroupCommand::execute(){
37         try {
38                 vector<string> groupNames = groupMap->namesOfGroups;    
39                 for(int i = 0; i < groupNames.size(); i++)
40                         cout << groupNames[i] << "\n";
41                 return 0;       
42         }
43
44         catch(exception& e) {
45                 cout << "Standard Error: " << e.what() << " has occurred in the GetgroupCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
46                 exit(1);
47         }
48         catch(...) {
49                 cout << "An unknown error has occurred in the GetgroupCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
50                 exit(1);
51         }       
52 }
53
54