#include <creaImageIOGimmick.h>
Public Types | |
typedef TreeHandlerImageAdder::Progress | AddProgress |
typedef TreeHandlerImageAdder::ProgressCallbackType | AddProgressCallbackType |
typedef std::map < std::string, TreeHandler * > | TreeHandlerMapType |
Type of map from TreeHandler name to TreeHandler*. | |
Public Member Functions | |
Gimmick () | |
Ctor. | |
~Gimmick () | |
Dtor. | |
void | ConnectAddProgressObserver (AddProgressCallbackType callback) |
const AddProgress & | GetAddProgress () const |
void | Initialize () |
Initialize (read/creates databases, etc.). | |
void | Finalize () |
Finalize (closes databases, etc.). | |
TreeHandlerMapType & | GetTreeHandlerMap () |
Returns the TreeHandlerMap (ref). | |
const TreeHandlerMapType & | GetTreeHandlerMap () const |
Returns the TreeHandlerMap (const ref). | |
void | AddFiles (const std::string &handler, const std::vector< std::string > &filenames) |
Add the files to the given TreeHandler. | |
void | AddDir (const std::string &handler, const std::string &path, bool recurse) |
Add a dir to the given TreeHandler. | |
void | RemoveFile (const std::string &d, tree::Node *filename) |
Removes a file from the given TreeHandler. | |
void | DeleteDrive (const std::string &drive) |
Deletes the given drive name from the databases. | |
void | CopyFiles (const std::vector< std::string > &filenames, const std::string &d) |
Copies the files into the local directory. | |
std::string | Synchronize (const std::string &d, bool repair, bool checkAttributes) |
void | Print (const std::string &handler) |
Prints the tree handled by the handler. | |
SQLiteTreeHandler * | createDB (const std::string &i_name, const std::string &i_locDesc, const std::string &i_locDB) |
create a DB from a given descriptor file and for a specific location | |
void | addDB (const std::string &i_nameDB, const std::string &i_locationDB) |
TreeHandler * | GetTreeHandler (const std::string &name) const |
Returns the TreeHandler with a given name. | |
TimestampDatabaseHandler * | GetTimestampDatabase () const |
Returns the TimestampDatabase. | |
SQLiteTreeHandler * | GetLocalDatabase () |
const SQLiteTreeHandler * | GetLocalDatabase () const |
void | GetSetting (const std::string &name, std::string &value) |
Returns the given setting value for the given setting parameter. | |
void | UpdateSetting (const std::string &name, const std::string &value) |
Updates the settings file. | |
void | addDBSettings () |
add DB from Settings file | |
void | EditField (tree::Node *node, const std::string &d, const std::string &name, const std::string &key, const std::string &val) |
Edits the field described by the name and key provided with the value given. | |
void | GetAttributes (const std::string &d, const std::string &filename, const std::vector< std::string > ¶ms, std::vector< std::string > &results) |
Returns the attributes in results described in params. | |
const std::string & | GetHomeDirectory () |
const std::string & | GetUserSettingsDirectory () |
void | CreateUserSettingsDirectory () |
const std::string & | GetLocalDatabasePath () |
const std::string & | GetTimestampDatabasePath () |
Static Public Member Functions | |
static void | SetMessageLevel (int level) |
Sets level for messages "Gimmick!". | |
static void | SetDebugMessageLevel (int level) |
Sets level for debug messages "Gimmick! DEBUG". | |
Private Attributes | |
SQLiteTreeHandler * | mLocalDatabase |
TimestampDatabaseHandler * | mTimestampDatabase |
TreeHandlerMapType | mTreeHandlerMap |
Synchronizer * | mSynchronizer |
std::string | mCurrentDirectory |
std::string | mHomeDirectory |
std::string | mUserSettingsDirectory |
std::string | mLocalDatabasePath |
std::string | mTimestampDatabasePath |
Settings * | mSettings |
TreeHandlerImageAdder | mImageAdder |
Definition at line 40 of file creaImageIOGimmick.h.
Definition at line 49 of file creaImageIOGimmick.h.
Definition at line 50 of file creaImageIOGimmick.h.
typedef std::map<std::string, TreeHandler*> creaImageIO::Gimmick::TreeHandlerMapType |
Type of map from TreeHandler name to TreeHandler*.
Definition at line 78 of file creaImageIOGimmick.h.
creaImageIO::Gimmick::Gimmick | ( | ) |
Ctor.
creaImageIO::Gimmick::~Gimmick | ( | ) |
Dtor.
void creaImageIO::Gimmick::ConnectAddProgressObserver | ( | AddProgressCallbackType | callback | ) | [inline] |
Adds the function f to the list of functions to call when addition operations progres. f is of type AddProgressCallbackType which is: void (*AddProgressCallbackType)(AddProgress&) To pass a member function 'f' of an instance 'c' of a class 'C' as callback you have to 'bind' it, i.e. call: ConnectAddProgressObserver ( boost::bind( &C::f , c, _1 ) );
Definition at line 59 of file creaImageIOGimmick.h.
00060 { mImageAdder.ConnectProgressObserver(callback); }
const AddProgress& creaImageIO::Gimmick::GetAddProgress | ( | ) | const [inline] |
void creaImageIO::Gimmick::Initialize | ( | ) |
Initialize (read/creates databases, etc.).
Referenced by main().
void creaImageIO::Gimmick::Finalize | ( | ) |
Finalize (closes databases, etc.).
Referenced by main().
static void creaImageIO::Gimmick::SetMessageLevel | ( | int | level | ) | [static] |
Sets level for messages "Gimmick!".
Referenced by main().
static void creaImageIO::Gimmick::SetDebugMessageLevel | ( | int | level | ) | [static] |
Sets level for debug messages "Gimmick! DEBUG".
Referenced by main().
TreeHandlerMapType& creaImageIO::Gimmick::GetTreeHandlerMap | ( | ) | [inline] |
Returns the TreeHandlerMap (ref).
Definition at line 81 of file creaImageIOGimmick.h.
00081 { return mTreeHandlerMap; }
const TreeHandlerMapType& creaImageIO::Gimmick::GetTreeHandlerMap | ( | ) | const [inline] |
Returns the TreeHandlerMap (const ref).
Definition at line 83 of file creaImageIOGimmick.h.
00084 { return mTreeHandlerMap; }
void creaImageIO::Gimmick::AddFiles | ( | const std::string & | handler, | |
const std::vector< std::string > & | filenames | |||
) |
Add the files to the given TreeHandler.
Referenced by main().
void creaImageIO::Gimmick::AddDir | ( | const std::string & | handler, | |
const std::string & | path, | |||
bool | recurse | |||
) |
Add a dir to the given TreeHandler.
Referenced by main().
void creaImageIO::Gimmick::RemoveFile | ( | const std::string & | d, | |
tree::Node * | filename | |||
) |
Removes a file from the given TreeHandler.
void creaImageIO::Gimmick::DeleteDrive | ( | const std::string & | drive | ) |
Deletes the given drive name from the databases.
void creaImageIO::Gimmick::CopyFiles | ( | const std::vector< std::string > & | filenames, | |
const std::string & | d | |||
) |
Copies the files into the local directory.
Referenced by main().
std::string creaImageIO::Gimmick::Synchronize | ( | const std::string & | d, | |
bool | repair, | |||
bool | checkAttributes | |||
) |
Synchronizes the loaded data with the database d. If repair is true the database will be updated, otherwise only a warning sign will be issued
Referenced by main().
void creaImageIO::Gimmick::Print | ( | const std::string & | handler | ) |
SQLiteTreeHandler* creaImageIO::Gimmick::createDB | ( | const std::string & | i_name, | |
const std::string & | i_locDesc, | |||
const std::string & | i_locDB | |||
) |
create a DB from a given descriptor file and for a specific location
void creaImageIO::Gimmick::addDB | ( | const std::string & | i_nameDB, | |
const std::string & | i_locationDB | |||
) |
TreeHandler* creaImageIO::Gimmick::GetTreeHandler | ( | const std::string & | name | ) | const |
Returns the TreeHandler with a given name.
Referenced by main().
TimestampDatabaseHandler* creaImageIO::Gimmick::GetTimestampDatabase | ( | ) | const |
Returns the TimestampDatabase.
SQLiteTreeHandler* creaImageIO::Gimmick::GetLocalDatabase | ( | ) | [inline] |
const SQLiteTreeHandler* creaImageIO::Gimmick::GetLocalDatabase | ( | ) | const [inline] |
void creaImageIO::Gimmick::GetSetting | ( | const std::string & | name, | |
std::string & | value | |||
) |
Returns the given setting value for the given setting parameter.
void creaImageIO::Gimmick::UpdateSetting | ( | const std::string & | name, | |
const std::string & | value | |||
) |
Updates the settings file.
void creaImageIO::Gimmick::addDBSettings | ( | ) |
add DB from Settings file
void creaImageIO::Gimmick::EditField | ( | tree::Node * | node, | |
const std::string & | d, | |||
const std::string & | name, | |||
const std::string & | key, | |||
const std::string & | val | |||
) |
Edits the field described by the name and key provided with the value given.
void creaImageIO::Gimmick::GetAttributes | ( | const std::string & | d, | |
const std::string & | filename, | |||
const std::vector< std::string > & | params, | |||
std::vector< std::string > & | results | |||
) |
Returns the attributes in results described in params.
const std::string& creaImageIO::Gimmick::GetHomeDirectory | ( | ) |
const std::string& creaImageIO::Gimmick::GetUserSettingsDirectory | ( | ) |
void creaImageIO::Gimmick::CreateUserSettingsDirectory | ( | ) |
const std::string& creaImageIO::Gimmick::GetLocalDatabasePath | ( | ) |
const std::string& creaImageIO::Gimmick::GetTimestampDatabasePath | ( | ) |
Definition at line 161 of file creaImageIOGimmick.h.
Definition at line 162 of file creaImageIOGimmick.h.
Definition at line 163 of file creaImageIOGimmick.h.
Synchronizer* creaImageIO::Gimmick::mSynchronizer [private] |
Definition at line 164 of file creaImageIOGimmick.h.
std::string creaImageIO::Gimmick::mCurrentDirectory [private] |
Definition at line 166 of file creaImageIOGimmick.h.
std::string creaImageIO::Gimmick::mHomeDirectory [private] |
Definition at line 167 of file creaImageIOGimmick.h.
std::string creaImageIO::Gimmick::mUserSettingsDirectory [private] |
Definition at line 168 of file creaImageIOGimmick.h.
std::string creaImageIO::Gimmick::mLocalDatabasePath [private] |
Definition at line 169 of file creaImageIOGimmick.h.
std::string creaImageIO::Gimmick::mTimestampDatabasePath [private] |
Definition at line 170 of file creaImageIOGimmick.h.
Settings* creaImageIO::Gimmick::mSettings [private] |
Definition at line 171 of file creaImageIOGimmick.h.
Definition at line 172 of file creaImageIOGimmick.h.