#include #include #include #include #include namespace creaImageIO { //============================================================== Gimmick::Gimmick() { crea::MessageManager::RegisterMessageType("Gimmick!", "Gimmick",1); } //============================================================== //============================================================== Gimmick::~Gimmick() { } //============================================================== //============================================================== bool Gimmick::Initialize() { // Create the UserSettings dir if does not exist if (!CreateUserSettingsDirectory()) return false; // Sets the current directory to the home dir mCurrentDirectory = GetHomeDirectory(); // Create local database handler mLocalDatabase = new SQLiteTreeHandler(GetLocalDatabasePath()); // Create or open local database if (! boost::filesystem::exists( GetLocalDatabasePath() ) ) { creaMessage("Gimmick!",1, "[Gimmick!] Local database '"<GetTree().GetDescriptor().CreateDefault(); if ( ! mLocalDatabase->Create(true) ) { creaMessage("Gimmick!",1, "[Gimmick!] !! ERROR CREATING '"<SetAttribute(0,"Name","Local database"); } else { /// Open and test it creaMessage("Gimmick!",1, "[Gimmick!] Opening local database '" <Open(true) ) { creaMessage("Gimmick!",1, "[Gimmick!] !! ERROR OPENING '"<GetTree().Print(); } //======================================================================== }