]> git.donarmstrong.com Git - mothur.git/blobdiff - mothur.h
added screen.seqs command - pds
[mothur.git] / mothur.h
index 07bb971347d974066ab5449614172c5e68d4c2a6..670a32c8326a76da2cf894cac0d7ad10a9a10825 100644 (file)
--- a/mothur.h
+++ b/mothur.h
@@ -249,7 +249,7 @@ inline string getPathName(string longName){
  
        string rootPathName = longName;
        
-       if(longName.find_last_of("/") != longName.npos){
+       if(longName.find_last_of('/') != longName.npos){
                int pos = longName.find_last_of('/')+1;
                rootPathName = longName.substr(0, pos);
        }
@@ -259,6 +259,20 @@ inline string getPathName(string longName){
 
 /***********************************************************************/
 
+inline string getExtension(string longName){
+       
+       string extension = longName;
+       
+       if(longName.find_last_of('.') != longName.npos){
+               int pos = longName.find_last_of('.');
+               extension = longName.substr(pos, longName.length());
+       }
+       
+       return extension;
+}
+
+/***********************************************************************/
+
 inline int openInputFile(string fileName, ifstream& fileHandle){
 
        fileHandle.open(fileName.c_str());