SET(bbCreatePackage_DATA_REL_PATH ../${BBTK_DATA_REL_PATH}/bbCreatePackage)
IF(WIN32)
+message("EED " ${CMAKE_CURRENT_SOURCE_DIR})
+message("EED " ${CMAKE_CURRENT_BINARY_DIR})
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/bbCreatePackage.bat.in
${CMAKE_CURRENT_BINARY_DIR}/bbCreatePackage.bat
#-----------------------------------------------------------------------------
# Path for binaries
-SET (EXECUTABLE_OUTPUT_REL_PATH bin)
-SET (LIBRARY_OUTPUT_REL_PATH bin)
+IF(WIN32)
+ SET (EXECUTABLE_OUTPUT_REL_PATH "")
+ SET (LIBRARY_OUTPUT_REL_PATH "")
+ELSE(WIN32)
+ SET (EXECUTABLE_OUTPUT_REL_PATH bin)
+ SET (LIBRARY_OUTPUT_REL_PATH bin)
+ENDIF(WIN32)
+
SET (EXECUTABLE_OUTPUT_PATH
${PROJECT_BINARY_DIR}/${EXECUTABLE_OUTPUT_REL_PATH})
SET (LIBRARY_OUTPUT_PATH
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 6")
SET(BBTK_BIN_PATH ${EXECUTABLE_OUTPUT_PATH}/$(IntDir))
ELSE(CMAKE_GENERATOR STREQUAL "Visual Studio 6")
- SET(BBTK_BIN_PATH $(SolutionDir)/bin/$(OutDir))
+ SET(BBTK_BIN_PATH $(SolutionDir)/$(OutDir))
ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 6")
SET(BBTK_BBI ${BBTK_BIN_PATH}/bbi.exe)
SET(BBTK_BBFY ${BBTK_BIN_PATH}/bbfy.exe)
Program: bbtk
Module: $RCSfile: bbtkConfigurationFile.cxx,v $
Language: C++
- Date: $Date: 2008/03/03 08:06:36 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2008/03/10 06:24:12 $
+ Version: $Revision: 1.13 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See doc/license.txt or
#include <direct.h> // for getcwd
#endif
+
+
namespace bbtk
{
ConfigurationFile::ConfigurationFile()
{
- // file separator
-#if defined(_WIN32)
- mFile_separator = "\\";
-#else
- mFile_separator = "/";
-#endif
+ mFile_separator = VALID_FILE_SEPARATOR;
// ==> Set system paths
mBin_path = GetExecutablePath();
- mInstall_path = mBin_path + mFile_separator + "..";
+//EED mInstall_path = mBin_path + mFile_separator + "..";
+ mInstall_path = mBin_path + "/..";
// The relative path to the doc folder (=BBTK_DOC_REL_PATH)
mDoc_rel_path = BBTK_STRINGIFY_SYMBOL(BBTK_DOC_REL_PATH);
-//EED mDoc_rel_path = BBTK_STRINGIFY_SYMBOL(doc);
// The path to the doc folder (=mInstall_path+"/"+mDoc_rel_path)
- mDoc_path = mInstall_path + mFile_separator + mDoc_rel_path;
+//EED mDoc_path = mInstall_path + mFile_separator + mDoc_rel_path;
+ mDoc_path = mInstall_path + "/" + mDoc_rel_path;
// The relative path to the doc folder (=BBTK_BBS_REL_PATH)
mBbs_rel_path = BBTK_STRINGIFY_SYMBOL(BBTK_BBS_REL_PATH);
// The path to the bbs folder (=mInstall_path+"/"+mBbs_rel_path)
- mBbs_path = mInstall_path + mFile_separator + mBbs_rel_path;
+//EED mBbs_path = mInstall_path + mFile_separator + mBbs_rel_path;
+ mBbs_path = mInstall_path + "/" + mBbs_rel_path;
// The relative path to the rsc folder (=BBTK_RSC_REL_PATH)
// mRsc_rel_path = BBTK_STRINGIFY_SYMBOL(BBTK_RSC_REL_PATH);
// The path to the rsc folder (=mInstall_path+"/"+mRsc_rel_path)
// The path to the bbtk data folder
// Initialized to mInstall_path+"/"+BBTK_DATA_REL_PATH
// But can be overriden by value read from bbtk_config.xml
- mData_path = mInstall_path + mFile_separator + BBTK_STRINGIFY_SYMBOL(BBTK_DATA_REL_PATH);
+//EED mData_path = mInstall_path + mFile_separator + BBTK_STRINGIFY_SYMBOL(BBTK_DATA_REL_PATH);
+ mData_path = mInstall_path + "/" + BBTK_STRINGIFY_SYMBOL(BBTK_DATA_REL_PATH);
+
+ Utilities::replace( mBin_path , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
+ Utilities::replace( mInstall_path , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
+ Utilities::replace( mDoc_rel_path , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
+ Utilities::replace( mDoc_path , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
+ Utilities::replace( mBbs_path , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
+ Utilities::replace( mData_path , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
bbtkMessage("Config",1," ==> bin : '"<<mBin_path<<"'"<<std::endl);
bbtkMessage("Config",1," ==> prefix : '"<<mInstall_path<<"'"<<std::endl);
bbtkMessage("Config",1," ==> doc : '"<<mDoc_path<<"'"<<std::endl);
bbtkMessage("Config",1," ==> bbs : '"<<mBbs_path<<"'"<<std::endl);
bbtkMessage("Config",1," ==> data : '"<<mData_path<<"'"<<std::endl);
-
+
+
+
// bbs_paths
// always add "." (current working directory) at the begining
- mBbs_paths.push_back(".");
+ mBbs_paths.push_back( "." );
// add system bbs path
mBbs_paths.push_back(mBbs_path);
// add toolsbbtk/appli
- std::string toolsappli_rel_path(mFile_separator);
- toolsappli_rel_path += "toolsbbtk" + mFile_separator + "appli";
+//EED std::string toolsappli_rel_path(mFile_separator);
+ std::string toolsappli_rel_path("/");
+//EED toolsappli_rel_path += "toolsbbtk" + mFile_separator + "appli";
+ toolsappli_rel_path += "toolsbbtk/appli";
mBbs_paths.push_back(mBbs_path + toolsappli_rel_path);
-#ifdef WIN32
- //EED for windows BUILD tree
- std::string winbbspath = mInstall_path + mFile_separator + ".." + mFile_separator + mBbs_rel_path;
- mBbs_paths.push_back(winbbspath);
- // add toolsbbtk/appli
- mBbs_paths.push_back(winbbspath + toolsappli_rel_path);
-#endif
-
+ int iStrVec,sizeStrVec;
+
+ sizeStrVec = mBbs_paths.size();
+ for (iStrVec=0;iStrVec<sizeStrVec;iStrVec++){
+ Utilities::replace( mBbs_paths[iStrVec] , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
+ }
+
// always add "." (current working directory) at the begining
mPackage_paths.push_back(".");
// add system bin path (for build tree / standalone folder install)
mPackage_paths.push_back(mBin_path);
// add system lib path (for install tree)
- mPackage_paths.push_back(mInstall_path + mFile_separator + "lib");
+//EED mPackage_paths.push_back(mInstall_path + mFile_separator + "lib");
+ mPackage_paths.push_back(mInstall_path + "/lib");
#ifdef WIN32
// add bin/Debug bin/Release paths (for build/install tree)
- mPackage_paths.push_back(mBin_path + mFile_separator + "Debug");
- mPackage_paths.push_back(mBin_path + mFile_separator + "Release");
+//EED mPackage_paths.push_back(mBin_path + mFile_separator + "Debug");
+ mPackage_paths.push_back(mBin_path + "/Debug");
+//EED mPackage_paths.push_back(mBin_path + mFile_separator + "Release");
+ mPackage_paths.push_back(mBin_path + "/Release");
#endif
-
+
+ sizeStrVec = mPackage_paths.size();
+ for (iStrVec=0;iStrVec<sizeStrVec;iStrVec++){
+ Utilities::replace( mPackage_paths[iStrVec] , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
+ }
+
+
+
GetHelp(2);
// ==> First we look for bbtk_config.xml in "."
// LG : throw an exception
}
- std::string configXmlFullPathName = currentDir + mFile_separator + "bbtk_config.xml";
-
+// std::string configXmlFullPathName = currentDir + mFile_separator + "bbtk_config.xml";
+ std::string configXmlFullPathName = currentDir ;
+ configXmlFullPathName += "/bbtk_config.xml";
+ Utilities::replace( configXmlFullPathName , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
+
if ( Utilities::FileExists( configXmlFullPathName ))
{
bbtkMessage("Config",1, "ConfigurationFile : [" << configXmlFullPathName <<
#elif defined(_WIN32)
std::string str_home(getenv("USERPROFILE"));
#endif
- configXmlFullPathName = str_home + mFile_separator + ".bbtk/bbtk_config.xml";
+//EED configXmlFullPathName = str_home + mFile_separator + ".bbtk/bbtk_config.xml";
+ configXmlFullPathName = str_home + "/.bbtk/bbtk_config.xml";
+ Utilities::replace( configXmlFullPathName , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
+
if (!Utilities::FileExists( configXmlFullPathName ))
{
// ==> Nothing found, we create bbtk_config.xml in ".bbtk"
Program: bbtk
Module: $RCSfile: bbtkConfigurationFile.h,v $
Language: C++
- Date: $Date: 2008/02/14 10:47:51 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2008/03/10 06:24:12 $
+ Version: $Revision: 1.6 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See doc/license.txt or
#include <vector>
+ // file separator
+#if defined(_WIN32)
+#define VALID_FILE_SEPARATOR "\\"
+#define INVALID_FILE_SEPARATOR "/"
+#else
+#define INVALID_FILE_SEPARATOR "\\"
+#define VALID_FILE_SEPARATOR "/"
+#endif
+
+
+
namespace bbtk
{
//==========================================================================
inline const std::string& Get_data_path() const
{ return mData_path;}
inline const std::string& Get_file_separator() const
- { return mFile_separator;}
+ { return mFile_separator;}
inline const std::string& Get_bin_path() const
{ return mBin_path;}
Module: $RCSfile: bbtkFactory.cxx,v $
Language: C++
-Date: $Date: 2008/03/07 10:21:30 $
-Version: $Revision: 1.28 $
+Date: $Date: 2008/03/10 06:24:12 $
+Version: $Revision: 1.29 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
//===================================================================
void Factory::Reset()
{
+printf("EED kkkkkkkkkkkkkkkkkkkkkkkk Factory::Reset() \n");
+printf("EED kkkkkkkkkkkkkkkkkkkkkkkk Factory::Reset() \n");
+printf("EED kkkkkkkkkkkkkkkkkkkkkkkk Factory::Reset() \n");
+printf("EED kkkkkkkkkkkkkkkkkkkkkkkk Factory::Reset() \n");
+printf("EED kkkkkkkkkkkkkkkkkkkkkkkk Factory::Reset() \n");
+printf("EED kkkkkkkkkkkkkkkkkkkkkkkk Factory::Reset() \n");
bbtkDebugMessageInc("Kernel",7,"Factory::Reset()"<<std::endl);
CloseAllPackages();
bbtkDebugDecTab("Kernel",7);
Program: bbtk
Module: $RCSfile: bbtkInterpreter.cxx,v $ $
Language: C++
- Date: $Date: 2008/03/07 11:15:15 $
- Version: $Revision: 1.41 $
+ Date: $Date: 2008/03/10 06:24:13 $
+ Version: $Revision: 1.42 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
try
{
SwitchToFile(filename);
+
+printf("EED Interpreter::InterpretFile 0001\n" );
+int ii,ssize = mFileName.size();
+for (ii=0;ii<ssize;ii++)
+{
+ printf("EED RRR Interpreter::InterpretFile %s\n", mFileName[ii].c_str() );
+}
+
bool insideComment = false; // for multiline comment
while (mFile.size()>0)
{
+printf("EED --- %s --- Interpreter::InterpretFile \n", mFileName[0].c_str() );
while ((mFile.size()>0) &&
(!mFile.back()->eof()))
+//EED3 (!mFile[0]->eof()))
{
mLine.back()++;
char buf[500];
mFile.back()->getline(buf,500);
+//EED3 mFile[0]->getline(buf,500);
std::string str(buf);
int size=str.length();
}
InterpretLine(str, insideComment);
+printf("EED Interpreter::InterpretFile %s\n", str.c_str() );
}
//if (mFile.size()>0)
CloseCurrentFile();
}
foundFile = true;
-
+ Filenames.clear();
int nbFiles = Utilities::Explore(fullDirectoryName, false, Filenames);
nbBssFiles = 0;
for (std::vector<std::string>::iterator i = Filenames.begin(); i!= Filenames.end(); ++i)
{
+//EEDprintf("EED Interpreter::SwitchToFile %s\n",(*i).c_str() );
if ((*i).substr((*i).size()-4, 4) != ".bbs")
continue; // ignore non .bbs files
std::string command("include ");
void Interpreter::LoadScript( std::string fullPathScriptName,
std::string includeScriptName)
{
- if (find(mFileName.begin(),mFileName.end(),fullPathScriptName)
- !=mFileName.end())
+//EED printf("EED Interpreter::LoadScript >>01\n");
+ Utilities::replace( fullPathScriptName , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
+
+ bool okScriptExist=false;
+ int iStrScript,sizeVecStricpt=mFileName.size();
+ for ( iStrScript=0;iStrScript<sizeVecStricpt;iStrScript++)
+ {
+//EED printf(" EED %d Interpreter::LoadScript %s __>>__ %s\n", iStrScript,mFileName[iStrScript].c_str(),fullPathScriptName.c_str() );
+ if (mFileName[iStrScript] == fullPathScriptName )
+ {
+ printf(" EED %d Interpreter::LoadScript iguales\n",iStrScript );
+ okScriptExist=true;
+ } // if
+ } // for
+
+ if (find(mFileName.begin(),mFileName.end(),fullPathScriptName)!=mFileName.end())
+// if (okScriptExist==true)
{
+//EED printf("EED Interpreter::LoadScript Exit method\n");
bbtkMessage("Interpreter",1,"file '"<<fullPathScriptName
<<"' already open : I do not open it once more to prevent recursive inclusion"<<std::endl);
return;
mFileName.push_back(fullPathScriptName);
mIncludeFileName.push_back(includeScriptName);
mLine.push_back(0);
+//EED printf("EED Interpreter::LoadScript >>02\n");
return;
}
return;
}
+ bbtkDebugMessage("Interpreter",9," Closing file '"<<mFileName.back()<<"'"<<std::endl);
mFile.back()->close();
delete mFile.back();
mFile.pop_back();
- bbtkDebugMessage("Interpreter",9,
- " Closing file '"<<mFileName.back()<<"'"<<std::endl);
-
mFileName.pop_back();
mIncludeFileName.pop_back();
- mLine.pop_back();
+ mLine.pop_back();
+/*EED3
+ bbtkDebugMessage("Interpreter",9," Closing file '"<<mFileName[0]<<"'"<<std::endl);
+ mFile[0]->close();
+ delete mFile[0];
+ mFile.erase( mFile.begin() );
+ mFileName.erase( mFileName.begin() );
+ mIncludeFileName.erase( mIncludeFileName.begin() );
+ mLine.erase( mLine.begin() );
+*/
+
bbtkDebugMessage("Interpreter",9," Remains "
<<mFile.size()
<<" open"<<std::endl);
Program: bbtk
Module: $RCSfile: bbtkUtilities.h,v $
Language: C++
- Date: $Date: 2008/02/18 10:41:02 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2008/03/10 06:24:13 $
+ Version: $Revision: 1.13 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See doc/license.txt or
//========================================================================
static inline void replace( std::string& str,
- const std::string& from,
- const std::string& to )
+ const std::string& what,
+ const std::string& with )
{
- using std::string;
- string::size_type pos = str.find( from );
- while ( pos != string::npos )
+ std::string::size_type pos = str.find( what );
+ while ( pos != std::string::npos )
{
- str.replace( pos, from.size(), to );
- pos = str.find( from, pos+from.size()-1 );
+ str.replace( pos, what.size(), with );
+ pos = str.find( what, pos+what.size()-1 );
}
}
//========================================================================
Program: bbtk
Module: $RCSfile: bbtkWxConsole.cxx,v $
Language: C++
- Date: $Date: 2008/03/07 11:37:48 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2008/03/10 06:24:13 $
+ Version: $Revision: 1.9 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//EED SetSizer(sizer);
SetAutoLayout(true);
Layout();
-
+ Refresh();
}
//================================================================
Program: bbtk
Module: $RCSfile: bbwxColourSelectorButton.cxx,v $
Language: C++
- Date: $Date: 2008/02/20 11:36:29 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2008/03/10 06:24:13 $
+ Version: $Revision: 1.2 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* Long
* description
*
- */
+ */
#ifdef _USE_WXWIDGETS_
Program: bbtk
Module: $RCSfile: bbwxCommandButton.cxx,v $
Language: C++
- Date: $Date: 2008/03/07 11:37:48 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2008/03/10 06:24:13 $
+ Version: $Revision: 1.3 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
- This software is distributed WITHOUT ANY WARRANTY; without even
+ This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.