X-Git-Url: http://www.andromeda.nl/gitweb/?a=blobdiff_plain;f=src%2Finclude%2Fdatabase.h;h=4532bfb87000c6742d40ac67cb598b90e188e093;hb=3676a26d3272ab4db47847f73869536617b78f34;hp=60f3796380f3086274783b9a4c829d3be1d7c9bb;hpb=7e2b806f26741a643fe74ed5c09be6d0189f5ac9;p=gnucomo.git diff --git a/src/include/database.h b/src/include/database.h index 60f3796..4532bfb 100644 --- a/src/include/database.h +++ b/src/include/database.h @@ -76,6 +76,8 @@ #include #include "gnucomo_config.h" +#define DEBUG + /* /////////////////////////////////////////////////////////////////////////// // NAME : gnucomo_database @@ -197,22 +199,34 @@ public: class database_entity { - const gnucomo_database *db; + gnucomo_database *db; String table; + String connected_table; bool fresh; // Completely new, no tuple in the database bool changed; // A database update is needed bool deleted; // Tuple is to be deleted from the database +protected: + + std::map fields; + public: - database_entity(const gnucomo_database &gdb, const String tbl) - { - db = &gdb; - table = tbl; + database_entity(gnucomo_database &gdb, const String tbl) + { + db = &gdb; + table = tbl; + + fresh = true; + changed = false; + deleted = false; + } + + // contruct a new database entity from the result of another one + database_entity(database_entity *from, int row); + + int find_one(String key); + int find_many(String tab, String where); - fresh = true; - changed = false; - deleted = false; - } };