From 1d58557e4ce9f1b2d54db61937c161d889d6558b Mon Sep 17 00:00:00 2001 From: westcott Date: Sun, 2 Aug 2009 20:55:29 +0000 Subject: [PATCH] bugs fixes while testing for 1.5 release --- collectsharedcommand.cpp | 3 +-- engine.cpp | 7 ++++--- fileoutput.cpp | 18 +++++++++--------- mothur.h | 5 ++++- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/collectsharedcommand.cpp b/collectsharedcommand.cpp index 3fed167..e158dbb 100644 --- a/collectsharedcommand.cpp +++ b/collectsharedcommand.cpp @@ -255,10 +255,9 @@ int CollectSharedCommand::execute(){ processedLabels.insert(order->getLabel()); userLabels.erase(order->getLabel()); userLines.erase(count); - - //you have a label the user want that is smaller than this line and the last line has not already been processed } + //you have a label the user want that is smaller than this line and the last line has not already been processed if ((anyLabelsToProcess(order->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) { delete order; order = input->getSharedOrderVector(lastLabel); diff --git a/engine.cpp b/engine.cpp index 95c0ff0..e589803 100644 --- a/engine.cpp +++ b/engine.cpp @@ -119,9 +119,10 @@ bool BatchEngine::getInput(){ while(quitCommandCalled == 0){ if (inputBatchFile.eof()) { input = "quit()"; } - else { input = getline(inputBatchFile); } - - + else { getline(inputBatchFile, input); } + //cout << "input = "; + //for (int i = 0; i < input.size(); i++) { cout << input[i]; if ((input[i] == '\n') || (input[i] == '\r')) { char c = input[i]; cout << "line feed = " << c << endl; } } + //cout << endl; if (input[0] != '#') { diff --git a/fileoutput.cpp b/fileoutput.cpp index 597a05a..df1bfec 100644 --- a/fileoutput.cpp +++ b/fileoutput.cpp @@ -27,7 +27,7 @@ void ThreeColumnFile::initFile(string label){ openInputFile(inName, inFile); string inputBuffer; - inputBuffer = getline(inFile); + getline(inFile, inputBuffer); outFile << inputBuffer << '\t' << label << "\tlci\thci" << endl; } @@ -51,7 +51,7 @@ void ThreeColumnFile::output(int nSeqs, vector data){ try { if(counter != 0){ string inputBuffer; - inputBuffer = getline(inFile); + getline(inFile, inputBuffer); outFile << inputBuffer << setprecision(4) << '\t' << data[0] << '\t' << data[1] << '\t' << data[2] << endl; } @@ -110,7 +110,7 @@ void ColumnFile::initFile(string label, vector tags){ openInputFile(inName, inFile); string inputBuffer; - inputBuffer = getline(inFile); + getline(inFile, inputBuffer); outFile << inputBuffer << '\t'; for(int i = 0; i < tags.size(); i++) { @@ -142,7 +142,7 @@ void ColumnFile::output(vector data){ if(counter != 0){ string inputBuffer; - inputBuffer = getline(inFile); + getline(inFile, inputBuffer); outFile << inputBuffer << '\t' << setprecision(6) << data[0] << setprecision(iters.length()); for (int i = 1; i< data.size(); i++) { @@ -210,7 +210,7 @@ void SharedThreeColumnFile::initFile(string label){ openInputFile(inName, inFile); string inputBuffer; - inputBuffer = getline(inFile); + getline(inFile, inputBuffer); outFile << inputBuffer << '\t' << label << "\tlci\thci" << endl; } @@ -234,7 +234,7 @@ void SharedThreeColumnFile::output(int nSeqs, vector data){ try { if(counter != 0){ string inputBuffer; - inputBuffer = getline(inFile); + getline(inFile, inputBuffer); outFile << inputBuffer << setprecision(4) << '\t' << data[0] << '\t' << data[1] << '\t' << data[2] << endl; } @@ -294,7 +294,7 @@ void OneColumnFile::initFile(string label){ openInputFile(inName, inFile); string inputBuffer; - inputBuffer = getline(inFile); + getline(inFile, inputBuffer); outFile << inputBuffer << '\t' << label << endl; } @@ -318,7 +318,7 @@ void OneColumnFile::output(int nSeqs, vector data){ try { if(counter != 0){ string inputBuffer; - inputBuffer = getline(inFile); + getline(inFile, inputBuffer); outFile << inputBuffer << setprecision(4) << '\t' << data[0] << endl; } @@ -376,7 +376,7 @@ void SharedOneColumnFile::initFile(string label){ openInputFile(inName, inFile); string inputBuffer; - inputBuffer = getline(inFile); + getline(inFile, inputBuffer); outFile << inputBuffer << '\t' << label << endl; diff --git a/mothur.h b/mothur.h index b27c5ad..7d6b1d8 100644 --- a/mothur.h +++ b/mothur.h @@ -44,9 +44,12 @@ #include #include #include -#include #include +#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) + #include +#endif + using namespace std; #define exp(x) (exp((double) x)) -- 2.39.2