]> git.donarmstrong.com Git - mothur.git/blob - getgroupcommand.cpp
Added get.line command.
[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
14
15
16 GetgroupCommand::GetgroupCommand(){
17         try {
18                 globaldata = GlobalData::getInstance();
19                 groupMap = globaldata->gGroupmap;
20         }
21         catch(exception& e) {
22                 cout << "Standard Error: " << e.what() << " has occurred in the GetgroupCommand class Function GetgroupCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
23                 exit(1);
24         }
25         catch(...) {
26                 cout << "An unknown error has occurred in the GetgroupCommand class function GetgroupCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
27                 exit(1);
28         }       
29                         
30 }
31
32 //**********************************************************************************************************************
33
34 GetgroupCommand::~GetgroupCommand(){
35 }
36
37 //**********************************************************************************************************************
38
39 int GetgroupCommand::execute(){
40         try {
41                 vector<string> groupNames = groupMap->namesOfGroups;    
42                 for(int i = 0; i < groupNames.size(); i++)
43                         cout << groupNames[i] << "\n";
44                 return 0;       
45         }
46
47         catch(exception& e) {
48                 cout << "Standard Error: " << e.what() << " has occurred in the GetgroupCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
49                 exit(1);
50         }
51         catch(...) {
52                 cout << "An unknown error has occurred in the GetgroupCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
53                 exit(1);
54         }       
55 }
56
57