diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-04-19 14:22:18 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-04-19 14:22:18 (GMT) |
| commit | c4bace95bf97546ecb2fff4343fe82d0540d34ab (patch) | |
| tree | a35378f9a3062041751606239d82fd45e92b7062 /src/client/Client.cpp | |
| parent | e9fc64eed6e5cbf5e750063e1ad2e30887840dbf (diff) | |
| download | powder-c4bace95bf97546ecb2fff4343fe82d0540d34ab.zip powder-c4bace95bf97546ecb2fff4343fe82d0540d34ab.tar.gz | |
Allow deleting of stamps
Diffstat (limited to 'src/client/Client.cpp')
| -rw-r--r-- | src/client/Client.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/client/Client.cpp b/src/client/Client.cpp index 9e4732b..9a11084 100644 --- a/src/client/Client.cpp +++ b/src/client/Client.cpp @@ -5,6 +5,7 @@ #include <vector> #include <iomanip> #include <time.h> +#include <stdio.h> #ifdef WIN32 #include <direct.h> @@ -221,7 +222,7 @@ Save * Client::GetStamp(string stampID) stampFile.close(); - Save * tempSave = new Save(0, 0, 0, 0, "", ""); + Save * tempSave = new Save(0, 0, 0, 0, "", stampID); tempSave->SetData(tempData, fileSize); return tempSave; } @@ -233,7 +234,15 @@ Save * Client::GetStamp(string stampID) void Client::DeleteStamp(string stampID) { - return; + for(int i = 0; i < stampIDs.size(); i++) + { + if(stampIDs[i] == stampID) + { + remove(string(STAMPS_DIR PATH_SEP + stampID + ".stm").c_str()); + stampIDs.erase(stampIDs.begin()+i); + return; + } + } } string Client::AddStamp(Save * saveData) |
