OODataBase.h
From Giona
(Difference between revisions)
Line 1: | Line 1: | ||
+ | <pre> | ||
+ | #ifndef OODATABASE_H_ | ||
+ | #define OODATABASE_H_ | ||
+ | #include "gionaTypes.h" | ||
+ | #include "Debug.h" | ||
+ | #include "SqliteDb.h" | ||
+ | #include "SqliteDBResultSet.h" | ||
+ | #include "GenericObject.h" | ||
+ | #include "GenericAttribute.h" | ||
+ | |||
+ | class OODataBase | ||
+ | { | ||
+ | public: | ||
+ | |||
+ | static const int NO_ERROR = 0; | ||
+ | static const int ERROR_SQLITEDB = 1; | ||
+ | static const int ERROR_NULL_PARAMETER = 2; | ||
+ | static const int ERROR_OBJECT_EXISTS_YET = 3; | ||
+ | static const int ERROR_EMPTY_STRING = 4; | ||
+ | static const int ERROR_OBJECT_NOT_FOUND = 5; | ||
+ | |||
+ | |||
+ | OODataBase(); | ||
+ | virtual ~OODataBase(); | ||
+ | |||
+ | bool setDatabaseName(STRING databaseName); | ||
+ | STRING getDatabaseName(); | ||
+ | int getLastError(); | ||
+ | |||
+ | bool connect(); | ||
+ | bool disconnect(); | ||
+ | bool storeNewObject(GenericObject* object); | ||
+ | bool updateObject(GenericObject* object); | ||
+ | bool deleteObject(STRING name); | ||
+ | GenericObject* getObjectByName(STRING name); | ||
+ | STRING* getObjectNameList(); | ||
+ | |||
+ | |||
+ | private: | ||
+ | SqliteDb* db; | ||
+ | int lastError; | ||
+ | bool init(); | ||
+ | }; | ||
+ | |||
+ | #endif /*OODATABASE_H_*/ | ||
+ | |||
+ | </pre> | ||
[[Il database Object Oriented Generico|BACK]] | [[Il database Object Oriented Generico|BACK]] | ||
[[Category:Codice Sorgente]] | [[Category:Codice Sorgente]] |
Current revision as of 10:43, 18 December 2007
#ifndef OODATABASE_H_ #define OODATABASE_H_ #include "gionaTypes.h" #include "Debug.h" #include "SqliteDb.h" #include "SqliteDBResultSet.h" #include "GenericObject.h" #include "GenericAttribute.h" class OODataBase { public: static const int NO_ERROR = 0; static const int ERROR_SQLITEDB = 1; static const int ERROR_NULL_PARAMETER = 2; static const int ERROR_OBJECT_EXISTS_YET = 3; static const int ERROR_EMPTY_STRING = 4; static const int ERROR_OBJECT_NOT_FOUND = 5; OODataBase(); virtual ~OODataBase(); bool setDatabaseName(STRING databaseName); STRING getDatabaseName(); int getLastError(); bool connect(); bool disconnect(); bool storeNewObject(GenericObject* object); bool updateObject(GenericObject* object); bool deleteObject(STRING name); GenericObject* getObjectByName(STRING name); STRING* getObjectNameList(); private: SqliteDb* db; int lastError; bool init(); }; #endif /*OODATABASE_H_*/