]> git.donarmstrong.com Git - mothur.git/blobdiff - utilities.hpp
fixed unweighted calculator
[mothur.git] / utilities.hpp
index cc6c4900d459828e5fbd2a9336754e589e160266..90d10c1cc4e96f34561c37f81738015158957488 100644 (file)
@@ -4,6 +4,7 @@
 using namespace std;
 
 #include "mothur.h"
+#include "treemap.h"
 
 typedef unsigned long long ull;
 
@@ -333,8 +334,23 @@ inline void splitAtEquals(string& key, string& value){
        }
 
 }
-/*******************************************************/
-
+/**************************************************************************************************/
 
+inline bool inUsersGroups(string groupname, vector<string> Groups) {
+       try {
+               for (int i = 0; i < Groups.size(); i++) {
+                       if (groupname == Groups[i]) { return true; }
+               }
+               return false;
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the utilities class Function inUsersGroups. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the utilities class function inUsersGroups. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
 
 #endif