]> git.donarmstrong.com Git - mothur.git/blobdiff - nameassignment.cpp
fixed bugs in venn and aligner
[mothur.git] / nameassignment.cpp
index cf4e6774c32706d506d472963bda6f9ac86df7f1..c31468c36cbd422a5d8aa72a99cbfc02f7abb5ff 100644 (file)
@@ -33,19 +33,9 @@ void NameAssignment::readMap(){
                }
                fileHandle.close();
        
-//             map<string, string>::iterator it = data.begin();
-//             for(it;it!=data.end();it++){
-//                     cout << it->first << endl;
-//                     (*this)[it->first] = rowIndex;
-//                     rowIndex++;
-//             }
        }
        catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the NameAssignment class Function readMap. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }
-       catch(...) {
-               cout << "An unknown error has occurred in the NameAssignment class function readMap. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               errorOut(e, "NameAssignment", "readMap");
                exit(1);
        }
 }
@@ -62,17 +52,13 @@ ListVector NameAssignment::getListVector(void){
 
 void NameAssignment::print(void){
        try {
-               map<string,int>::iterator it = (*this).begin();
-               for(it;it!=(*this).end();it++){
-                       cout << it->first << '\t' << it->second << endl;  //prints out keys and values of the map this.
+               map<string,int>::iterator it;
+               for(it = (*this).begin(); it!=(*this).end(); it++){
+                       mothurOut(it->first + "\t" + toString(it->second)); mothurOutEndLine();  //prints out keys and values of the map this.
                }
        }
        catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the NameAssignment class Function print. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }
-       catch(...) {
-               cout << "An unknown error has occurred in the NameAssignment class function print. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               errorOut(e, "NameAssignment", "print");
                exit(1);
        }
 }