1 #ifndef __creaImageIOSynchronizer_h_INCLUDED__
2 #define __creaImageIOSynchronizer_h_INCLUDED__
4 #include <creaImageIOSQLiteTreeHandler.h>
5 #include <creaImageIOImageReader.h>
10 //=======================================================================
11 /// Synchronizes a given database with disk
16 Synchronizer(TreeHandler* th);
19 ///Sets the tree handler to use in order to synchronize with a given database
20 void SetTreeHandler(TreeHandler * handler){mHandler=handler;}
21 ///Synchronizes the database in the current tree handler with disk by doing the passed action. If it is true,
22 ///the database will be updated, otherwise a warning message will be returned.
23 std::string Synchronize(bool update);
24 ///Checks if the file given as a parameter exists in the drive
25 bool FileExists(std::string file);
26 ///Checks if the attributes of the node given as a parameter matchwith it correspondent file in disk
27 ///NB: This method doesn't check the existence of the file, so FileExists should be called before.
28 void AttributesMatch(bool update, std::string file, std::stringstream& mess);
33 TreeHandler* mHandler;
36 ///Synchronizes the given file, doing the action required and returning the result on the string supplied
37 void SynchronizeFile(bool update, std::string file, std::stringstream& message);
40 } // EO namespace creaImageIO