Program: bbtk
Module: $RCSfile: bbtkInterpreter.cxx,v $ $
Language: C++
- Date: $Date: 2008/03/26 08:51:43 $
- Version: $Revision: 1.56 $
+ Date: $Date: 2008/03/26 14:47:36 $
+ Version: $Revision: 1.57 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
#include "bbtkInterpreter.h"
+#include "bbtkExecuter.h"
+#include "bbtkTranscriptor.h"
#include "bbtkMessageManager.h"
#include "bbtkConfigurationFile.h"
#include "bbtkUtilities.h"
/**
*
*/
- Interpreter::Interpreter()
+ Interpreter::Interpreter(const std::string& cpp_file)
:
mUser(0),
mCommandLine(false),
bbtk::MessageManager::RegisterMessageType("Interpreter","Messages of the interpreter",0);
bbtkDebugMessageInc("Interpreter",9,"Interpreter::Interpreter()" <<std::endl);
- mExecuter = new bbtk::Executer();
+ if (cpp_file.size()!=0)
+ {
+ mExecuter = new bbtk::Transcriptor(cpp_file);
+ }
+ else
+ {
+ mExecuter = new bbtk::Executer();
+ }
mExecuter->SetInterpreter(this);
// For the time being, comment out previous line, and
}
else
{
- bbtkError("'"<<upath<<"' : not a valid folder");
+ bbtkError("'"<<upath<<"' : directory does not exist");
}
}
// ==== relative path provided : search all bbs path appended with
script_paths.push_back(full_path);
}
}
+ if (script_paths.empty())
+ {
+ bbtkError("no '"<<upath<<"' subdir found in search paths"
+ << std::endl);
+ }
+
}
// === search paths list complete : now explore it
- if (script_paths.empty())
- {
- bbtkMessage("Interpreter",1,
- "'"<<upath<<"' : No matching folder" << std::endl);
- }
std::vector<std::string>::iterator i;