* If a method takes a NON const reference you cannot provide a temporary (e.g. the return value of another method )
* The same passing pointers as references is both useless and problematic for temporaries
// @param i_location : DB location //
// return : - //
///////////////////////////////////////////////////////////////////////
- void Gimmick::addDB(std::string &i_name, std::string &i_location)
+ void Gimmick::addDB(const std::string &i_name,
+ const std::string &i_location)
{
if(mTreeHandlerMap.find(i_name) == mTreeHandlerMap.end())
{
// @param i_locDB : location of DB //
// return : the SQLiteTreeHandler object on DB //
/////////////////////////////////////////////////////////////////////////
- SQLiteTreeHandler *Gimmick::createDB(std::string &i_name, std::string &i_locDesc, std::string &i_locDB)
+ SQLiteTreeHandler *Gimmick::createDB(const std::string &i_name,
+ const std::string &i_locDesc,
+ const std::string &i_locDB)
{
SQLiteTreeHandler *sqlTreeH = new SQLiteTreeHandler(i_locDB);
// Create or open local database
//========================================================================
void Gimmick::RemoveFile(const std::string& d,
- const tree::Node* & node)
+ tree::Node* node)
{
mImageAdder.SetSynchronizer(mSynchronizer);
mTimestampDatabase->RemoveNode("PATH",node);
/// Removes a file from the given TreeHandler
void RemoveFile(const std::string& d,
- const tree::Node* & filename);
+ tree::Node* filename);
///Synchronizes the loaded data with the database. If remove is true the database will be updated, otherwise
///only a warning sign will be issued
/// Prints the tree handled by the handler
void Print(const std::string& handler);
- ///create a DB from a given descriptor file and for a specific location
- SQLiteTreeHandler *createDB(std::string &i_name, std::string &i_locDesc, std::string &i_locDB);
+ ///create a DB from a given descriptor file and for a specific location
+ SQLiteTreeHandler *createDB(const std::string &i_name,
+ const std::string &i_locDesc,
+ const std::string &i_locDB);
// add an existent DB
- void addDB(std::string &i_nameDB, std::string &i_locationDB);
+ void addDB(const std::string &i_nameDB, const std::string &i_locationDB);
/// Returns the TreeHandler with a given name
TreeHandler* GetTreeHandler(const std::string& name) const;
{ GimmickError("INTERNAL ERROR : ClearSelection not implemented"); }
///Adds a file to ignore
- virtual void AddIgnoreFile(const tree::Node* & toRemove)
+ virtual void AddIgnoreFile(tree::Node* toRemove)
{ GimmickError("INTERNAL ERROR : AddIgnoreFile not implemented"); }
#include <boost/filesystem.hpp>
-
+#include <fstream>
namespace creaImageIO
// @param : file path //
// return : - //
//////////////////////////////////////////////////////////////
- void Descriptor::createDescriptorfromFile(std::string &i_name)
+ void Descriptor::createDescriptorfromFile(const std::string &i_name)
{
Clear();
void Clear();
//Create Attribute Descriptors from a file
- void createDescriptorfromFile(std::string &i_file);
+ void createDescriptorfromFile(const std::string &i_file);
private:
LevelDescriptorListType mLevelDescriptorList;
}
//=====================================================================
- void TreeHandlerImageAdder::RemoveFile( const tree::Node*& node)
+ void TreeHandlerImageAdder::RemoveFile( tree::Node* node)
{
int n=node->GetNumberOfChildren();
if(n>0)
void AddDirectory( const std::string& directory,
bool recurse);
/// Removes a file from the databases
- void RemoveFile(const tree::Node*& node);
+ void RemoveFile(tree::Node* node);
/// Removes files from the databases
void RemoveFiles(const std::vector<tree::Node*>& nodes);
/// Synchronizes the DB and disk by repeating the operations the user has done and returns a report
//=================================================
- void WxGimmickView::AddIgnoreFile(const tree::Node* & toRemove)
+ void WxGimmickView::AddIgnoreFile(tree::Node* toRemove)
{
mGimmick->RemoveFile("Local database",toRemove);
GetTreeViewMap()["Local database"]->UpdateLevel(1);
for(int i = 0; i< files.size(); i++)
{
//get name of DB (file name)
- size_t pos = files[i].find_last_of("\\");
- std::string name = crea::wx2std(files[i].substr(pos+1));
- pos = name.find_last_of(".");
- name = name.substr(0,pos);
- //create TreeHandler
- mGimmick->addDB(name, crea::wx2std(files[i]));
- //create TreeView
- CreateSingleTreeView(name);
+ size_t pos = files[i].find_last_of(_T("\\"));
+ std::string name = crea::wx2std(files[i].substr(pos+1));
+ pos = name.find_last_of(".");
+ name = name.substr(0,pos);
+ //create TreeHandler
+ mGimmick->addDB(name, crea::wx2std(files[i]));
+ //create TreeView
+ CreateSingleTreeView(name);
}
}
}
bool isSelection, int selection, bool mProcess);
///Stops the player
void StopPlayer(){mViewer->StopPlayer();}
- ///Adds a file to ignore
- void AddIgnoreFile(const tree::Node* & toRemove);
+ ///Adds a file to ignore
+ void AddIgnoreFile(tree::Node* toRemove);
///Resets the default image
void ClearSelection();
/* XPM */
-static char *synchronize_xpm[] = {
+static const char *synchronize_xpm[] = {
/* columns rows colors chars-per-pixel */
"48 50 155 2",
" c #2FBF25",