initialising searchpath system and some cleanup

git-svn-id: https://clonekeenplus.svn.sourceforge.net/svnroot/clonekeenplus/cgenius/trunk@148 4df4b0f3-56ce-47cb-b001-ed939b7d65a6
This commit is contained in:
albertzeyer
2009-07-24 15:05:36 +00:00
parent dcc4c9b777
commit 60bce8a456
7 changed files with 65 additions and 45 deletions

View File

@@ -8,13 +8,13 @@
#include "CParser.h"
#include "../CLogFile.h"
#include "../StringUtils.h"
#include "../sdl/CSettings.h"
#include <cstdio>
#include <cstdlib>
std::string CONFIGFILENAME = "genius.cfg";
CParser::CParser() {
m_configfile = CONFIGFILENAME;
m_isOpen = false;
}
@@ -41,7 +41,7 @@ bool CParser::loadParseFile() // Open, read the list and close the file
{
FILE *fp;
if((fp=fopen(CONFIGFILENAME.c_str(),"rt")))
if((fp=fopen(m_configfile.c_str(),"rt")))
{
while(!feof(fp))
{
@@ -62,7 +62,7 @@ bool CParser::saveParseFile() // open, write on the file and close
{
FILE *fp;
if((fp=fopen(CONFIGFILENAME.c_str(),"wt")))
if((fp=fopen(m_configfile.c_str(),"wt")))
{
for(std::list<std::string>::iterator i=m_filebuffer.begin() ; i != m_filebuffer.end() ; ++i )
fprintf(fp,"%s\n",i->c_str());

View File

@@ -13,8 +13,6 @@
#include <string>
#include <cstdio>
extern std::string CONFIGFILENAME;
class CParser {
public:
CParser();
@@ -39,6 +37,7 @@ public:
bool isOpen() {return m_isOpen;}
private:
std::string m_configfile;
bool m_isOpen;
std::list<std::string> m_filebuffer;