+bool Bayesian::checkReleaseDate(ifstream& file1, ifstream& file2, ifstream& file3, ifstream& file4) {
+ try {
+
+ bool good = true;
+
+ vector<string> lines;
+ lines.push_back(m->getline(file1));
+ lines.push_back(m->getline(file2));
+ lines.push_back(m->getline(file3));
+ lines.push_back(m->getline(file4));
+
+ //before we added this check
+ if ((lines[0][0] != '#') || (lines[1][0] != '#') || (lines[2][0] != '#') || (lines[3][0] != '#')) { good = false; }
+ else {
+ //rip off #
+ for (int i = 0; i < lines.size(); i++) { lines[i] = lines[i].substr(1); }
+
+ //get mothurs current version
+ string version = m->getVersion();
+
+ vector<string> versionVector;
+ m->splitAtChar(version, versionVector, '.');
+
+ //check each files version
+ for (int i = 0; i < lines.size(); i++) {
+ vector<string> linesVector;
+ m->splitAtChar(lines[i], linesVector, '.');
+
+ if (versionVector.size() != linesVector.size()) { good = false; break; }
+ else {
+ for (int j = 0; j < versionVector.size(); j++) {
+ int num1, num2;
+ convert(versionVector[j], num1);
+ convert(linesVector[j], num2);
+
+ //if mothurs version is newer than this files version, then we want to remake it
+ if (num1 > num2) { good = false; break; }
+ }
+ }
+
+ if (!good) { break; }
+ }
+ }
+
+ if (!good) { file1.close(); file2.close(); file3.close(); file4.close(); }
+ else { file1.seekg(0); file2.seekg(0); file3.seekg(0); file4.seekg(0); }
+
+ return good;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "Bayesian", "checkReleaseDate");
+ exit(1);
+ }
+}
+/**************************************************************************************************/