more code for searchpath system

git-svn-id: https://clonekeenplus.svn.sourceforge.net/svnroot/clonekeenplus/cgenius/trunk@146 4df4b0f3-56ce-47cb-b001-ed939b7d65a6
This commit is contained in:
albertzeyer
2009-07-24 14:36:34 +00:00
parent 4ca87c10e1
commit bb08df4b19
4 changed files with 51 additions and 21 deletions
+8 -13
View File
@@ -11,7 +11,7 @@
#include <cstdio>
#include <cstdlib>
#define CONFIGFILENAME "genius.cfg"
std::string CONFIGFILENAME = "genius.cfg";
CParser::CParser() {
@@ -41,7 +41,7 @@ bool CParser::loadParseFile() // Open, read the list and close the file
{
FILE *fp;
if((fp=fopen(CONFIGFILENAME,"rt")))
if((fp=fopen(CONFIGFILENAME.c_str(),"rt")))
{
while(!feof(fp))
{
@@ -52,12 +52,9 @@ bool CParser::loadParseFile() // Open, read the list and close the file
fclose(fp);
return true;
}
else
{
g_pLogFile->ftextOut(GREEN,"Parser : The file has not been found. When CKP is trying to save the file it will create a new one.");
return false;
}
g_pLogFile->ftextOut(GREEN,"Parser : The file has not been found. When CKP is trying to save the file it will create a new one.");
return false;
}
// Close the text which was parsed. This will also copy all stuff of the memory to the file.
@@ -65,7 +62,7 @@ bool CParser::saveParseFile() // open, write on the file and close
{
FILE *fp;
if((fp=fopen(CONFIGFILENAME,"wt")))
if((fp=fopen(CONFIGFILENAME.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());
@@ -73,11 +70,9 @@ bool CParser::saveParseFile() // open, write on the file and close
fclose(fp);
return true;
}
else
{
g_pLogFile->ftextOut(RED,"Parser : Error opening the file for write operations. Check your permissions or if the disk is full");
return false;
}
g_pLogFile->ftextOut(RED,"Parser : Error opening the file for write operations. Check your permissions or if the disk is full");
return false;
}
// read the value of the to be seeked keyword and returns it as an int.
+2
View File
@@ -13,6 +13,8 @@
#include <string>
#include <cstdio>
extern std::string CONFIGFILENAME;
class CParser {
public:
CParser();