#include <creaImageIOGimmick.h>
#include <creaImageIOSystem.h>
-#include <creaImageIOImageFinder.h>
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
//==============================================================
Gimmick::Gimmick()
+ : mImageAdder(0)
{
RegisterGimmickMessageTypes();
}
//========================================================================
- /// Add a file to the local database
- void Gimmick::AddFile(const std::string& d, const std::string& f)
+ /// Add the files to the tree handler
+ void Gimmick::AddFiles(const std::string& d,
+ const std::vector<std::string>& filenames)
{
- GimmickMessage(2,"Adding file '"<<f<<"' to '"<<d<<"'"<<std::endl);
+ GimmickMessage(2,"Adding files to '"<<d<<"'"<<std::endl);
- ImageFinder finder(GetTreeHandler(d));
- if (finder.IsHandledFile(f))
- {
- finder.AddFile(f);
- }
- else
- {
- GimmickError("File '"<<f<<"' does not exist or is not handled");
- }
+ mImageAdder.SetTreeHandler(GetTreeHandler(d));
+ mImageAdder.AddFiles(filenames);
+
}
//========================================================================
GimmickMessage(2,"Adding dir '"<<f<<"' to '"<<d<<"' recurse:"
<<recurse<<std::endl);
- ImageFinder finder(GetTreeHandler(d));
-
- finder.AddDirectory(f,recurse);
+ mImageAdder.SetTreeHandler(GetTreeHandler(d));
+ mImageAdder.AddDirectory(f,recurse);
}
//========================================================================