X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=utilities.hpp;h=90d10c1cc4e96f34561c37f81738015158957488;hb=3c5c4e255ee8c36feb9e97aebc4e792e6ff8c440;hp=8f5009ffc4f0306a5da950e75a541aaa56cfb572;hpb=addc715b6d7ea52440751cec10edad03e1a19b37;p=mothur.git diff --git a/utilities.hpp b/utilities.hpp index 8f5009f..90d10c1 100644 --- a/utilities.hpp +++ b/utilities.hpp @@ -3,14 +3,8 @@ using namespace std; -#include -#include -#include -#include -#include -#include -#include -#include +#include "mothur.h" +#include "treemap.h" typedef unsigned long long ull; @@ -340,8 +334,23 @@ inline void splitAtEquals(string& key, string& value){ } } -/*******************************************************/ - +/**************************************************************************************************/ +inline bool inUsersGroups(string groupname, vector 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