From 158915fafe286df69a68374032187ae283eb4ded Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 23 May 2008 14:55:39 +0000 Subject: Did a lot of work on the database class. --- server/src/database.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'server/src/database.h') diff --git a/server/src/database.h b/server/src/database.h index 157cf6d..51c0f1a 100644 --- a/server/src/database.h +++ b/server/src/database.h @@ -28,10 +28,16 @@ #define __PRACRO_DATABASE_H__ #include + #include #include "transaction.h" +#include "template.h" #include +#include + +typedef std::map< std::string, std::string > Fields; + class Database { public: Database(std::string hostname = "localhost", @@ -39,13 +45,17 @@ public: std::string password = "pracro"); ~Database(); - int post(std::string &user, std::string &cpr, time_t now, Commit &commit); - // Make a commit to the db - void commit() {} + void commit(std::string user, + std::string cpr, + Macro ¯o, + Fields &fields, + time_t now = time(NULL)); // Get a list of values from the db - void getValues() {} + Fields getValues(std::string cpr, + std::vector< std::string > &fieldnames, + time_t oldest = 0); // Connect to the db void connect() {} -- cgit v1.2.3