]> 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 836808395e118e3c1518272d0d01c79948ce4a8a..0dc9796582297d38a4a24b8832d149c3a6951089 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 448fc9ba9fd79c27f82ed89e3b2bcd5d7dd2e23a..99908d6077e8e9e7c6227bc261edb5e3f41665b3 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 a6b073764818e4508cbad6240554ba7f47dadbce..258cc74f5b0e8d3e95c4304e7369e01bf0b2b000 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 2fe9efd993e00563c461bca9ad2a56e981b2e70e..521f0ffc13bf31d4d7fe8a6c1b45b0d44f7aa89c 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);
+