X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=mothurout.cpp;h=b30ee3ca630c91fea01343c9d873e709e027a4fb;hb=8173238f9f94af9baab8471de58bed7c8830948d;hp=b1d818850bd974ff482bc8c88ffc4bdc0a3dc7bd;hpb=794b3f789d6160c99b75edb9cf9af5cf3df4b9da;p=mothur.git diff --git a/mothurout.cpp b/mothurout.cpp index b1d8188..b30ee3c 100644 --- a/mothurout.cpp +++ b/mothurout.cpp @@ -9,6 +9,7 @@ #include "mothurout.h" + /******************************************************/ MothurOut* MothurOut::getInstance() { if( _uniqueInstance == 0) { @@ -359,18 +360,21 @@ string MothurOut::getline(ifstream& fileHandle) { } /***********************************************************************/ +#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) #ifdef USE_COMPRESSION inline bool endsWith(string s, const char * suffix){ size_t suffixLength = strlen(suffix); return s.size() >= suffixLength && s.substr(s.size() - suffixLength, suffixLength).compare(suffix) == 0; } #endif +#endif string MothurOut::getRootName(string longName){ try { string rootName = longName; +#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) #ifdef USE_COMPRESSION if (endsWith(rootName, ".gz") || endsWith(rootName, ".bz2")) { int pos = rootName.find_last_of('.'); @@ -378,7 +382,7 @@ string MothurOut::getRootName(string longName){ cerr << "shortening " << longName << " to " << rootName << "\n"; } #endif - +#endif if(rootName.find_last_of(".") != rootName.npos){ int pos = rootName.find_last_of('.')+1; rootName = rootName.substr(0, pos); @@ -632,7 +636,7 @@ int MothurOut::openInputFile(string fileName, ifstream& fileHandle, string m){ try { //get full path name string completeFileName = getFullPathName(fileName); - +#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) #ifdef USE_COMPRESSION // check for gzipped or bzipped file if (endsWith(completeFileName, ".gz") || endsWith(completeFileName, ".bz2")) { @@ -655,7 +659,7 @@ int MothurOut::openInputFile(string fileName, ifstream& fileHandle, string m){ } } #endif - +#endif fileHandle.open(completeFileName.c_str()); if(!fileHandle) { //mothurOut("[ERROR]: Could not open " + completeFileName); mothurOutEndLine(); @@ -678,7 +682,7 @@ int MothurOut::openInputFile(string fileName, ifstream& fileHandle){ //get full path name string completeFileName = getFullPathName(fileName); - +#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) #ifdef USE_COMPRESSION // check for gzipped or bzipped file if (endsWith(completeFileName, ".gz") || endsWith(completeFileName, ".bz2")) { @@ -701,7 +705,7 @@ int MothurOut::openInputFile(string fileName, ifstream& fileHandle){ } } #endif - +#endif fileHandle.open(completeFileName.c_str()); if(!fileHandle) { @@ -756,7 +760,7 @@ int MothurOut::openOutputFile(string fileName, ofstream& fileHandle){ try { string completeFileName = getFullPathName(fileName); - +#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) #ifdef USE_COMPRESSION // check for gzipped file if (endsWith(completeFileName, ".gz") || endsWith(completeFileName, ".bz2")) { @@ -776,7 +780,7 @@ int MothurOut::openOutputFile(string fileName, ofstream& fileHandle){ } } #endif - +#endif fileHandle.open(completeFileName.c_str(), ios::trunc); if(!fileHandle) { mothurOut("[ERROR]: Could not open " + completeFileName); mothurOutEndLine();