X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mothurout.cpp;h=9704464bf80326c87d4afa556e3353b95fcbf37e;hb=5a4ac4f954c4b4445bcee272f1f8220ddcc9c1e4;hp=14840c16e162bc599c242e289e3c5899fb396de4;hpb=f06b339c5fc4b6d1b9d2a08fe16bf7670bf7aeb4;p=mothur.git diff --git a/mothurout.cpp b/mothurout.cpp index 14840c1..9704464 100644 --- a/mothurout.cpp +++ b/mothurout.cpp @@ -43,7 +43,7 @@ set MothurOut::getCurrentTypes() { types.insert("tree"); types.insert("flow"); types.insert("biom"); - types.insert("counttable"); + types.insert("count"); types.insert("processors"); return types; @@ -79,7 +79,7 @@ void MothurOut::printCurrentFiles() { if (treefile != "") { mothurOut("tree=" + treefile); mothurOutEndLine(); } if (flowfile != "") { mothurOut("flow=" + flowfile); mothurOutEndLine(); } if (biomfile != "") { mothurOut("biom=" + biomfile); mothurOutEndLine(); } - if (counttablefile != "") { mothurOut("counttable=" + counttablefile); mothurOutEndLine(); } + if (counttablefile != "") { mothurOut("count=" + counttablefile); mothurOutEndLine(); } if (processors != "1") { mothurOut("processors=" + processors); mothurOutEndLine(); } } @@ -1052,6 +1052,9 @@ int MothurOut::openInputFile(string fileName, ifstream& fileHandle){ int MothurOut::renameFile(string oldName, string newName){ try { + + if (oldName == newName) { return 0; } + ifstream inTest; int exist = openInputFile(newName, inTest, ""); inTest.close(); @@ -2017,6 +2020,28 @@ bool MothurOut::mothurConvert(string item, int& num){ exit(1); } } +/***********************************************************************/ +bool MothurOut::mothurConvert(string item, intDist& num){ + try { + bool error = false; + + if (isNumeric1(item)) { + convert(item, num); + }else { + num = 0; + error = true; + mothurOut("[ERROR]: cannot convert " + item + " to an integer."); mothurOutEndLine(); + commandInputsConvertError = true; + } + + return error; + } + catch(exception& e) { + errorOut(e, "MothurOut", "mothurConvert"); + exit(1); + } +} + /***********************************************************************/ bool MothurOut::isNumeric1(string stringToCheck){ try {