mirror of
https://github.com/glest/glest-source.git
synced 2025-09-26 07:28:59 +02:00
Added the ability to tell mega-glest where to look for glest.ini, servers.ini and all of the various .log files. The new optional environment variable that mega-glest will look for is:
GLESTHOME
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <cstring>
|
||||
|
||||
#include "conversion.h"
|
||||
#include "util.h"
|
||||
#include "leak_dumper.h"
|
||||
|
||||
using namespace std;
|
||||
@@ -29,17 +30,22 @@ namespace Shared{ namespace Util{
|
||||
void Properties::load(const string &path){
|
||||
|
||||
ifstream fileStream;
|
||||
char lineBuffer[maxLine];
|
||||
char lineBuffer[maxLine]="";
|
||||
string line, key, value;
|
||||
int pos;
|
||||
int pos=0;
|
||||
|
||||
this->path= path;
|
||||
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] path = [%s]\n",__FILE__,__FUNCTION__,__LINE__,path.c_str());
|
||||
|
||||
fileStream.open(path.c_str(), ios_base::in);
|
||||
if(fileStream.fail()){
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] path = [%s]\n",__FILE__,__FUNCTION__,__LINE__,path.c_str());
|
||||
throw runtime_error("Can't open propertyMap file: " + path);
|
||||
}
|
||||
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] path = [%s]\n",__FILE__,__FUNCTION__,__LINE__,path.c_str());
|
||||
|
||||
propertyMap.clear();
|
||||
while(!fileStream.eof()){
|
||||
fileStream.getline(lineBuffer, maxLine);
|
||||
|
Reference in New Issue
Block a user