|
|
@@ -100,7 +100,7 @@ namespace oxygine
|
|
|
_nfs.unmount(fs);
|
|
|
}
|
|
|
|
|
|
- handle open(const char* file_, const char* mode, error_policy ep)
|
|
|
+ handle open(const std::string& file_, const char* mode, error_policy ep)
|
|
|
{
|
|
|
|
|
|
#ifdef OX_DEBUG
|
|
|
@@ -110,7 +110,7 @@ namespace oxygine
|
|
|
//OX_ASSERT(_openedFiles == 0);
|
|
|
LOGD("open file: %s %s %d", file_, mode, _openedFiles);
|
|
|
char file[512];
|
|
|
- path::normalize(file_, file);
|
|
|
+ path::normalize(file_.c_str(), file);
|
|
|
LOGD("q1");
|
|
|
|
|
|
|
|
|
@@ -146,23 +146,23 @@ namespace oxygine
|
|
|
return fh->tell();
|
|
|
}
|
|
|
|
|
|
- bool deleteFile(const char* path, error_policy ep)
|
|
|
+ bool deleteFile(const std::string& path, error_policy ep)
|
|
|
{
|
|
|
- bool ok = _nfs.deleteFile(path) == FileSystem::status_ok;
|
|
|
+ bool ok = _nfs.deleteFile(path.c_str()) == FileSystem::status_ok;
|
|
|
if (!ok)
|
|
|
{
|
|
|
- handleErrorPolicy(ep, "can't delete file: %s", path);
|
|
|
+ handleErrorPolicy(ep, "can't delete file: %s", path.c_str());
|
|
|
}
|
|
|
|
|
|
return ok;
|
|
|
}
|
|
|
|
|
|
- bool rename(const char* src, const char* dest, error_policy ep)
|
|
|
+ bool rename(const std::string& src, const std::string& dest, error_policy ep)
|
|
|
{
|
|
|
- bool ok = _nfs.renameFile(src, dest) == FileSystem::status_ok;
|
|
|
+ bool ok = _nfs.renameFile(src.c_str(), dest.c_str()) == FileSystem::status_ok;
|
|
|
if (!ok)
|
|
|
{
|
|
|
- handleErrorPolicy(ep, "can't rename file: %s to %s", src, dest);
|
|
|
+ handleErrorPolicy(ep, "can't rename file: %s to %s", src.c_str(), dest.c_str());
|
|
|
}
|
|
|
|
|
|
return ok;
|
|
|
@@ -177,11 +177,11 @@ namespace oxygine
|
|
|
return fh->read(dest, destSize);
|
|
|
}
|
|
|
|
|
|
- bool read(const char* file_, buffer& dest, error_policy ep)
|
|
|
+ bool read(const std::string& file_, buffer& dest, error_policy ep)
|
|
|
{
|
|
|
- LOGD("open file: %s %s %d", file_, mode, _openedFiles);
|
|
|
+ LOGD("open file: %s %s %d", file_.c_str(), mode, _openedFiles);
|
|
|
char file[512];
|
|
|
- path::normalize(file_, file);
|
|
|
+ path::normalize(file_.c_str(), file);
|
|
|
|
|
|
dest.data.clear();
|
|
|
bool ok = _nfs.read(file, dest, ep) == FileSystem::status_ok;
|
|
|
@@ -212,12 +212,12 @@ namespace oxygine
|
|
|
fh->write(data, size);
|
|
|
}
|
|
|
|
|
|
- void write(const char* file, const buffer& data, error_policy ep)
|
|
|
+ void write(const std::string& file, const buffer& data, error_policy ep)
|
|
|
{
|
|
|
write(file, data.getData(), data.getSize(), ep);
|
|
|
}
|
|
|
|
|
|
- void write(const char* file, const void* data, unsigned int size, error_policy ep)
|
|
|
+ void write(const std::string& file, const void* data, unsigned int size, error_policy ep)
|
|
|
{
|
|
|
autoClose ac(open(file, "wb", ep));
|
|
|
if (!ac.getHandle())
|
|
|
@@ -232,22 +232,22 @@ namespace oxygine
|
|
|
}
|
|
|
|
|
|
|
|
|
- bool exists(const char* file_)
|
|
|
+ bool exists(const std::string& file_)
|
|
|
{
|
|
|
char file[512];
|
|
|
- path::normalize(file_, file);
|
|
|
+ path::normalize(file_.c_str(), file);
|
|
|
|
|
|
return _nfs.isExists(file);
|
|
|
}
|
|
|
|
|
|
- bool makeDirectory(const char* path)
|
|
|
+ bool makeDirectory(const std::string& path)
|
|
|
{
|
|
|
- return _nfs.makeDirectory(path) == FileSystem::status_ok;
|
|
|
+ return _nfs.makeDirectory(path.c_str()) == FileSystem::status_ok;
|
|
|
}
|
|
|
|
|
|
- void deleteDirectory(const char* path)
|
|
|
+ void deleteDirectory(const std::string& path)
|
|
|
{
|
|
|
- _nfs.deleteDirectory(path);
|
|
|
+ _nfs.deleteDirectory(path.c_str());
|
|
|
}
|
|
|
|
|
|
file::STDFileSystem& fs()
|