]> git.donarmstrong.com Git - mothur.git/blobdiff - engine.cpp
finished wrapper for catchall
[mothur.git] / engine.cpp
index fbf986dc6965de7d9d269c31f35e99ed85467a9d..a90bb7e0588baee4f8d922687f99063c8d961387 100644 (file)
@@ -49,7 +49,7 @@ InteractEngine::InteractEngine(string path){
                
                //break apart path variable by ':'
                vector<string> dirs;
-               splitAtChar(envPath, dirs, delim);
+               mout->splitAtChar(envPath, dirs, delim);
                
                //get path related to mothur
                string mothurPath = "";
@@ -218,7 +218,7 @@ BatchEngine::BatchEngine(string path, string batchFileName){
        try {
                globaldata = GlobalData::getInstance();
        
-               openedBatch = openInputFile(batchFileName, inputBatchFile);
+               openedBatch = mout->openInputFile(batchFileName, inputBatchFile);
                
                string temppath = path.substr(0, (path.find_last_of('m')));
        
@@ -237,7 +237,7 @@ BatchEngine::BatchEngine(string path, string batchFileName){
                        
                        //break apart path variable by ':'
                        vector<string> dirs;
-                       splitAtChar(envPath, dirs, delim);
+                       mout->splitAtChar(envPath, dirs, delim);
                        
                        //get path related to mothur
                        string mothurPath = "";
@@ -370,7 +370,7 @@ bool BatchEngine::getInput(){
                                }
                                
                        }
-                       gobble(inputBatchFile);
+                       mout->gobble(inputBatchFile);
                }
                
                inputBatchFile.close();
@@ -388,7 +388,7 @@ string BatchEngine::getNextCommand(ifstream& inputBatchFile) {
                string nextcommand = "";
                
                if (inputBatchFile.eof()) { nextcommand = "quit()"; }
-               else { nextcommand = getline(inputBatchFile); }
+               else { nextcommand = mout->getline(inputBatchFile); }
                
                return nextcommand;
        }
@@ -425,7 +425,7 @@ ScriptEngine::ScriptEngine(string path, string commandString){
                        
                        //break apart path variable by ':'
                        vector<string> dirs;
-                       splitAtChar(envPath, dirs, delim);
+                       mout->splitAtChar(envPath, dirs, delim);
                        
                        //get path related to mothur
                        string mothurPath = "";
@@ -571,11 +571,16 @@ string ScriptEngine::getNextCommand(string& commandString) {
                
                string nextcommand = "";
                int count = 0;
+               bool ignoreSemiColons = false;
                
                //go through string until you reach ; or end
                while (count < commandString.length()) { 
                        
-                       if (commandString[count] == ';') {  break;   }
+                        //you want to ignore any ; until you reach the next '
+                       if ((commandString[count] == '\'') && (!ignoreSemiColons)) {  ignoreSemiColons = true;  } 
+                       else if ((commandString[count] == '\'') && (ignoreSemiColons)) {  ignoreSemiColons = false;  } 
+                               
+                       if ((commandString[count] == ';') && (!ignoreSemiColons)) {  break;   }
                        else {          nextcommand += commandString[count];    }
                        
                        count++;