X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOGimmick.cpp;h=90dc2c8fcf716f2a088eaa543fce4bcc5c12f0e6;hb=cc5a912f64e8de1f90d9ef0956633515a46d31ae;hp=2d759d0b29a2862547278e8aac7a379ae0e51d4f;hpb=d1635bf73accf21c07f6315ed04609d703250269;p=creaImageIO.git diff --git a/src2/creaImageIOGimmick.cpp b/src2/creaImageIOGimmick.cpp index 2d759d0..90dc2c8 100644 --- a/src2/creaImageIOGimmick.cpp +++ b/src2/creaImageIOGimmick.cpp @@ -39,7 +39,7 @@ namespace creaImageIO std::string dbpath = GetLocalDatabasePath(); // Create or open local database - mLocalDatabase = createDB( mCurrentDirectory + "\\.gimmick\\localdatabase_Descriptor.txt", dbpath); + mLocalDatabase = createDB(i_nameDB, mCurrentDirectory + "\\.gimmick\\localdatabase_Descriptor.txt", dbpath); // Add it to the TreeHandlerMap mTreeHandlerMap[i_nameDB] = mLocalDatabase; @@ -88,11 +88,12 @@ namespace creaImageIO /////////////////////////////////////////////////////////////////////////// // create a DB from a attributes descriptor file for medical images // + // @param i_name : DB name // // @param i_locDesc : location of descriptor file // // @param i_locDB : location of DB // // return : the SQLiteTreeHandler object on DB // ///////////////////////////////////////////////////////////////////////// - SQLiteTreeHandler *Gimmick::createDB(std::string &i_locDesc, std::string &i_locDB) + SQLiteTreeHandler *Gimmick::createDB(std::string &i_name, std::string &i_locDesc, std::string &i_locDB) { SQLiteTreeHandler *sqlTreeH = new SQLiteTreeHandler(i_locDB); // Create or open local database @@ -109,7 +110,7 @@ namespace creaImageIO { GimmickError("ERROR CREATING '"<SetAttribute(0,"Name","i_name"); + sqlTreeH->SetAttribute(0,"Name",i_name); } else { @@ -127,6 +128,7 @@ namespace creaImageIO //============================================================== void Gimmick::Finalize() { + // delete SQLiteTreeHandler Object for( TreeHandlerMapType::const_iterator it = mTreeHandlerMap.begin(); it!= mTreeHandlerMap.end(); ++it)