+inline string getline(ifstream& fileHandle) {
+ try {
+
+ string line = "";
+
+ while (!fileHandle.eof()) {
+ //get next character
+ char c = fileHandle.get();
+
+ //are you at the end of the line
+ if ((c == '\n') || (c == '\r') || (c == '\f')){ break; }
+ else { line += c; }
+ }
+
+ return line;
+
+ }
+ catch(exception& e) {
+ cout << "Error in mothur function getline" << endl;
+ exit(1);
+ }
+}
+
+/**************************************************************************************************/
+
+inline void mothurOut(string message) {
+ try{
+ ofstream out;
+ string logFileName = "mothur.logFile";
+ openOutputFileAppend(logFileName, out);
+
+ cout << message;
+ out << message;
+
+ out.close();
+ }
+ catch(exception& e) {
+ cout << "Error in mothur class mothurOut" << endl;
+ exit(1);
+ }
+}
+/**************************************************************************************************/
+
+inline void mothurOut(string message, string precision) {
+ try{
+ ofstream out;
+ string logFileName = "mothur.logFile";
+ openOutputFileAppend(logFileName, out);
+
+ cout << precision << message;
+ out << precision << message;
+
+ out.close();
+ }
+ catch(exception& e) {
+ cout << "Error in mothur class mothurOut" << endl;
+ exit(1);
+ }
+}
+
+/**************************************************************************************************/
+
+inline void mothurOutEndLine() {
+ try {
+ ofstream out;
+ string logFileName = "mothur.logFile";
+ openOutputFileAppend(logFileName, out);
+
+ cout << endl;
+ out << endl;
+
+ out.close();
+ }
+ catch(exception& e) {
+ cout << "error in mothur mothurOutEndLine" << endl;
+ exit(1);
+ }
+}
+
+
+/**************************************************************************************************/
+
+inline void errorOut(exception& e, string object, string function) {
+
+ mothurOut("Error: ");
+ mothurOut(toString(e.what()));
+ mothurOut(" has occurred in the " + object + " class function " + function + ". Please contact Pat Schloss at mothur.bugs@gmail.com, and be sure to include the mothur.logFile with your inquiry.");
+ mothurOutEndLine();
+
+}
+
+
+
+
+/***********************************************************************/
+
+inline bool isTrue(string f){
+
+ if ((f == "TRUE") || (f == "T") || (f == "true") || (f == "t")) { return true; }
+ else { return false; }
+}
+
+/***********************************************************************/
+