X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOTreeHandlerImageAdder.h;h=60654911c76c14976cd47a516c5f41b76f581901;hb=852af4a5c6e97a6fc349126cf3370e27f89fe067;hp=e490509100a1469e2837639ae6f42f29a06c6646;hpb=42f7c93a6f8fc2beeb8709be1b3616ec40f4699e;p=creaImageIO.git diff --git a/src2/creaImageIOTreeHandlerImageAdder.h b/src2/creaImageIOTreeHandlerImageAdder.h index e490509..6065491 100644 --- a/src2/creaImageIOTreeHandlerImageAdder.h +++ b/src2/creaImageIOTreeHandlerImageAdder.h @@ -3,9 +3,11 @@ #include #include +#include #include #include #include +#include // Signal/slot mechanism for progress events #include #include @@ -22,6 +24,7 @@ namespace creaImageIO class TreeHandlerImageAdder { + public: //==================================================================== /// Ctor @@ -32,6 +35,8 @@ namespace creaImageIO void SetTreeHandler(TreeHandler* tree) { mTreeHandler = tree;} /// Sets the TimestampDatabaseHandler void SetTimestampHandler(TimestampDatabaseHandler* tdh) { mTimestampHandler = tdh;} + /// Sets the synchronizer + void SetSynchronizer(Synchronizer* s){mSynchronizer=s;} //==================================================================== //==================================================================== @@ -101,7 +106,29 @@ namespace creaImageIO void AddFiles( const std::vector& filename ); /// (Recursively) adds the files of a directory to the TreeHandler void AddDirectory( const std::string& directory, - bool recurse ); + bool recurse); + /// Removes a file from the databases + void RemoveFile(tree::Node* node); + /// Removes files from the databases + void RemoveFiles(const std::vector& nodes); + /// Synchronizes the DB and disk by repeating the operations the user has done and returns a report + std::string Synchronize(bool repair, bool checkAttributes); + ///Recursively checks if the directory is synchronized and optionally the state of the attributes + void CheckSyncDirectory(const std::string &dirpath, + bool recursive, + bool repair, + bool checkAttributes, + std::vector &i_ignorefiles, + std::vector & attsModified, + std::vector & newfiles); + ///Finds the node that matches the specified parameters + void FindNode(tree::Node* parent, int level, + const std::string& searchParam, + const std::string& searchVal, + tree::Node*& node); + ///Checks the attributes of the database against the ones in disk + void CheckAttributes(bool repair, std::string& file, std::vector& attsModified); + //==================================================================== private: @@ -113,10 +140,12 @@ namespace creaImageIO /// Recursive method which does the main job for AddDirectory void AddDirectoryRecursor( const std::string& directory, - bool recurse ); + bool recurse, + const std::string &addKey); TreeHandler* mTreeHandler; TimestampDatabaseHandler* mTimestampHandler; + Synchronizer* mSynchronizer; ImageReader mReader; Progress mProgress;