]> Creatis software - creaImageIO.git/commitdiff
Added attribute reading functionality.
authorcaballero <caballero>
Tue, 9 Jun 2009 16:27:49 +0000 (16:27 +0000)
committercaballero <caballero>
Tue, 9 Jun 2009 16:27:49 +0000 (16:27 +0000)
src2/creaImageIOGimmick.cpp
src2/creaImageIOGimmick.h
src2/creaImageIOTreeHandlerImageAdder.cpp
src2/creaImageIOTreeHandlerImageAdder.h

index 8368083..0dc9796 100644 (file)
@@ -519,6 +519,22 @@ namespace creaImageIO
 
   //========================================================================
 
+  void Gimmick::GetAttributes(const std::string& d, 
+         const std::string& filename, 
+         const std::vector<std::string>& params, 
+         std::vector<std::string>& results)
+  {
+         TreeHandler * handler=GetTreeHandler(d);
+         mImageAdder.SetCurrentDatabase(d);
+         mImageAdder.SetTreeHandler(handler);
+         mImageAdder.SetTimestampHandler(mTimestampDatabase);
+         mImageAdder.SetSynchronizer(mSynchronizer);
+         mImageAdder.GetAttributes(params, filename, results);
+  }
+  //========================================================================
+
+  //========================================================================
+
   void Gimmick::UpdateSetting(const std::string& name, const std::string& value)
   {
          mSettings->updateSetting(name,value);
index 448fc9b..99908d6 100644 (file)
@@ -142,6 +142,12 @@ namespace creaImageIO
        ///Edits the field described by the name and key provided with the value given
        void EditField(tree::Node* node, const std::string& d, const std::string& name, const std::string& key, const std::string& val);
 
+       /// Returns the attributes in results described in params
+       void GetAttributes(const std::string& d, 
+         const std::string& filename, 
+         const std::vector<std::string>& params, 
+         std::vector<std::string>& results);
+  
     /// 
     const std::string& GetHomeDirectory();
     const std::string& GetUserSettingsDirectory();
index a6b0737..258cc74 100644 (file)
@@ -586,5 +586,19 @@ namespace creaImageIO
          mTreeHandler->SetAttribute(node,key,val);
   }
 
+  //=======================================================================
+  void TreeHandlerImageAdder::GetAttributes(const std::vector<std::string>& params, 
+         const std::string& filename, 
+         std::vector<std::string>& results)
+  {
+         std::vector<std::string>::const_iterator i;
+         std::string result;
+         for(i=params.begin();i!=params.end();i++)
+         {
+                 mTreeHandler->GetAttribute("Image","FullFileName",filename,*i,result);
+                 results.push_back(result);
+         }
+  }
+
  
 }
index 2fe9efd..521f0ff 100644 (file)
@@ -142,6 +142,11 @@ namespace creaImageIO
        void DeleteDriveFromOtherDB(const std::string& drive);
        ///Edits the given field and sets the new parameters
        void EditField(tree::Node* node, const std::string& name, const std::string& key, const std::string& val);
+       ///Returns the demanded attributes for the given file
+       void GetAttributes(const std::vector<std::string>& params, 
+         const std::string& filename, 
+         std::vector<std::string>& results);
+