- Fixed some bugs related to logfile processing.

- Added debug project to win32 projects
- Changed some compiler settings for win32 projects to enable sse
This commit is contained in:
Mark Vejvoda
2010-05-02 06:21:36 +00:00
parent 63aff0751c
commit abf05a2ae6
10 changed files with 148 additions and 41 deletions

View File

@@ -15,10 +15,10 @@
#include <string>
#include <fstream>
#include <map>
//#include "thread.h"
#include "thread.h"
using std::string;
//using namespace Shared::Platform;
using namespace Shared::Platform;
namespace Shared{ namespace Util{
@@ -45,7 +45,7 @@ public:
this->fileStream = NULL;
this->debugLogFileName = "";
this->fileStreamOwner = false;
//this->mutex = NULL;
this->mutex = NULL;
}
SystemFlagsType(DebugType debugType) {
this->debugType = debugType;
@@ -53,8 +53,11 @@ public:
this->fileStream = NULL;
this->debugLogFileName = "";
this->fileStreamOwner = false;
//this->mutex = NULL;
this->mutex = NULL;
}
~SystemFlagsType() {
Close();
}
SystemFlagsType(DebugType debugType,bool enabled,
std::ofstream *fileStream,std::string debugLogFileName) {
this->debugType = debugType;
@@ -62,14 +65,28 @@ public:
this->fileStream = fileStream;
this->debugLogFileName = debugLogFileName;
this->fileStreamOwner = false;
//this->mutex = mutex;
this->mutex = NULL;
}
void Close() {
if(this->fileStreamOwner == true) {
if( this->fileStream != NULL &&
this->fileStream->is_open() == true) {
this->fileStream->close();
}
delete this->fileStream;
delete this->mutex;
}
this->fileStream = NULL;
this->fileStreamOwner = false;
this->mutex = NULL;
}
bool enabled;
std::ofstream *fileStream;
std::string debugLogFileName;
bool fileStreamOwner;
//Mutex *mutex;
Mutex *mutex;
};
protected: