Changed: Replaced DeleteFile (Win32) by NLMISC::CFile::deleteFile

This commit is contained in:
kervala 2010-10-16 19:05:06 +02:00
parent 7cbb7da54e
commit 6ec0afb12a
2 changed files with 19 additions and 16 deletions

View file

@ -39,9 +39,10 @@
#include "nel/misc/i_xml.h"
#include "nel/misc/path.h"
#include "nel/misc/file.h"
#include "nel/misc/path.h"
#include "tools.h"
#include "../master/continentcfg.h"
#include "../master/ContinentCfg.h"
using namespace std;
using namespace NLMISC;
@ -50,7 +51,7 @@ using namespace NLLIGO;
using namespace NLGEORGES;
#define MAX_SYS_DIR 6
char *gExportSysDir[MAX_SYS_DIR] =
const char *gExportSysDir[MAX_SYS_DIR] =
{
".",
"..",
@ -85,7 +86,7 @@ void CExport::delIGZone (sint32 x, sint32 y)
{
string sZoneName = CExport::getZoneNameFromXY (x, y);
sZoneName += ".ig";
if (DeleteFile(sZoneName.c_str()))
if (CFile::deleteFile(deleteFile(sZoneName))
{
CTools::chdir (_ExeDir);
string sTmp = string(" zone ") + sZoneName + " deleted";
@ -1208,7 +1209,7 @@ bool CExport::newExport (SExportOptions &opt, IExportCB *expCB)
if (!CTools::fileExist(sNewName))
{
// Delete the oldest file
DeleteFile(vFiles[i].c_str());
CFile::deleteFile(vFiles[i]);
}
}
@ -1226,7 +1227,7 @@ bool CExport::newExport (SExportOptions &opt, IExportCB *expCB)
if (!CTools::fileExist(sNewName))
{
// Delete the oldest file
DeleteFile(vFiles[i].c_str());
CFile::deleteFile(vFiles[i]);
}
}
}

View file

@ -41,7 +41,9 @@
#include <memory>
#include <windows.h>
#ifdef NL_OS_WINDOWS
# include <windows.h>
#endif // NL_OS_WINDOWS
using namespace NL3D;
using namespace NLMISC;
@ -360,8 +362,8 @@ bool CExport::export_ (SExportOptions &options, IExportCB *expCB)
if (bMustDelete)
{
if (!DeleteFile (allFiles[nFile].c_str()))
{
if (!CFile::deleteFile (allFiles[nFile]))
{
if (_ExportCB != NULL)
_ExportCB->dispWarning (string("Can't delete ") + fileName);
}
@ -844,15 +846,15 @@ void CExport::treatPattern (sint32 x, sint32 y,
{
// Delete the .zone and .zonel file
DstZoneFileName = getZoneNameFromXY(x+deltaX+i, y+deltaY+j);
DstZoneFileName = _Options->OutZoneDir + string("\\") + DstZoneFileName;
DstZoneFileName = _Options->OutZoneDir + string("/") + DstZoneFileName;
string sTmp = DstZoneFileName + string(".zone");
DeleteFile (sTmp.c_str());
CFile::deleteFile (sTmp);
DstZoneFileName = DstZoneFileName + string(".zonel");
DeleteFile (DstZoneFileName.c_str());
CFile::deleteFile (DstZoneFileName);
// Delete the .zonenh file
string DstZoneNoHeightmapFileName = _Options->OutZoneDir + string("\\") + getZoneNameFromXY(x+deltaX+i, y+deltaY+j) + string(".zonenh");
DeleteFile (DstZoneNoHeightmapFileName.c_str());
string DstZoneNoHeightmapFileName = _Options->OutZoneDir + string("/") + getZoneNameFromXY(x+deltaX+i, y+deltaY+j) + string(".zonenh");
CFile::deleteFile (DstZoneNoHeightmapFileName);
COFile outFile (DstZoneFileName);
UnitZoneLighted.serial (outFile);
@ -876,9 +878,9 @@ void CExport::treatPattern (sint32 x, sint32 y,
try
{
dstIGFileName = getZoneNameFromXY(x+deltaX+i, y+deltaY+j);
dstIGFileName = _Options->OutIGDir + string("\\") + dstIGFileName + string(".ig");
DeleteFile (dstIGFileName.c_str());
COFile outFile (dstIGFileName);
dstIGFileName = _Options->OutIGDir + string("/") + dstIGFileName + string(".ig");
CFile::deleteFile (dstIGFileName);
COFile outFile (dstIGFileName);
unitIG.serial(outFile);
if (_ExportCB != NULL)
_ExportCB->dispInfo (string("Writing ") + getZoneNameFromXY(x+deltaX+i, y+deltaY+j) + ".ig");