diff options
| author | Choupom <andycootlapin@hotmail.fr> | 2010-09-03 20:05:22 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2010-09-05 17:40:51 +0200 |
| commit | fcfaa8389f968bc89fbd4afbfc70ea7c3815c7bb (patch) | |
| tree | 1633fe299e51715b94a07bc14637399ccd356dae /src/engine/shared/storage.cpp | |
| parent | 2800832e12684b5961bbef5291922d11e23b032a (diff) | |
| download | zcatch-fcfaa8389f968bc89fbd4afbfc70ea7c3815c7bb.tar.gz zcatch-fcfaa8389f968bc89fbd4afbfc70ea7c3815c7bb.zip | |
added Remove button in demos browser (#66)
Diffstat (limited to 'src/engine/shared/storage.cpp')
| -rw-r--r-- | src/engine/shared/storage.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/engine/shared/storage.cpp b/src/engine/shared/storage.cpp index e8b0f8bb..74f7cd3f 100644 --- a/src/engine/shared/storage.cpp +++ b/src/engine/shared/storage.cpp @@ -1,4 +1,5 @@ // copyright (c) 2007 magnus auvinen, see licence.txt for more info +#include <stdio.h> //remove() #include <base/system.h> #include <engine/storage.h> #include "engine.h" @@ -193,6 +194,18 @@ public: pBuffer[0] = 0; return 0; } + + virtual bool RemoveFile(const char *pFilename) + { + char aBuffer[1024]; + str_format(aBuffer, sizeof(aBuffer), "%s/%s", m_aApplicationSavePath, pFilename); + bool Fail = remove(aBuffer); + + if(Fail) + Fail = remove(pFilename); + + return !Fail; + } static IStorage *Create(const char *pApplicationName, int NumArgs, const char **ppArguments) { |