implementing get-function for sqliteLogFileName
This commit is contained in:
+3
-4
@@ -25,12 +25,10 @@
|
||||
#include <sqlite3.h>
|
||||
#include <dirent.h>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
using namespace std;
|
||||
using namespace boost::filesystem;
|
||||
|
||||
Log::Log(ConfigFile *c) : mySqliteLogDb(0), myConfig(c), uniqueGameID(0), currentHandID(0), currentRound(GAME_STATE_PREFLOP), sql("")
|
||||
Log::Log(ConfigFile *c) : mySqliteLogDb(0), mySqliteLogFileName(""), myConfig(c), uniqueGameID(0), currentHandID(0), currentRound(GAME_STATE_PREFLOP), sql("")
|
||||
{
|
||||
}
|
||||
|
||||
@@ -68,7 +66,8 @@ Log::init()
|
||||
strftime(curDate,11,"%Y-%m-%d",z);
|
||||
strftime(curTime,9,"%H:%M:%S",z);
|
||||
|
||||
path mySqliteLogFileName(myConfig->readConfigString("LogDir"));
|
||||
mySqliteLogFileName.clear();
|
||||
mySqliteLogFileName /= myConfig->readConfigString("LogDir");
|
||||
mySqliteLogFileName /= string("pokerth-log-") + curDateTime + ".pdb";
|
||||
|
||||
// open sqlite-db
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#define LOG_H
|
||||
|
||||
#include <string>
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
#include "engine_defs.h"
|
||||
#include "game_defs.h"
|
||||
@@ -56,12 +57,16 @@ public:
|
||||
currentRound = theValue;
|
||||
}
|
||||
|
||||
std::string getMySqliteLogFileName() {
|
||||
return mySqliteLogFileName.directory_string();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void exec_transaction();
|
||||
|
||||
sqlite3 *mySqliteLogDb;
|
||||
boost::filesystem::path mySqliteLogFileName;
|
||||
ConfigFile *myConfig;
|
||||
int uniqueGameID;
|
||||
int currentHandID;
|
||||
|
||||
Reference in New Issue
Block a user