Browse Source

added delete()

ncannasse 8 years ago
parent
commit
3bd2e21046
1 changed files with 8 additions and 0 deletions
  1. 8 0
      hxd/Save.hx

+ 8 - 0
hxd/Save.hx

@@ -58,6 +58,14 @@ class Save {
 		#end
 	}
 
+	public static function delete( name = "save" ) {
+		#if flash
+		throw "TODO";
+		#elseif sys
+		try sys.FileSystem.deleteFile(savePath(name)) catch( e : Dynamic ) {}
+		#end
+	}
+
 	public static function save( val : Dynamic, ?name = "save", checkSum = false ) {
 		#if flash
 		var data = saveData(val, checkSum);