Cleaned up love.filesystem.read/write code

This commit is contained in:
Alex Szpakowski
2013-03-17 03:30:36 -03:00
parent 8d4f35b86b
commit 96229bcb5d
3 changed files with 79 additions and 141 deletions
+9 -10
View File
@@ -232,20 +232,19 @@ public:
bool close(File *file);
/**
* Reads count bytes from an open file.
* The first parameter is either a File or
* a string. An optional second parameter specified the
* max number of bytes to read.
* Reads data from a file.
* @param filename The name of the file to read from.
* @param size The size in bytes of the data to read.
**/
int read(lua_State *L);
Data *read(const char *filename, int64 size) const;
/**
* Write the bytes in data to the file. File
* must be opened for write.
* The first parameter is either a File or
* a string.
* Write data to a file.
* @param filename The name of the file to write to.
* @param data The data to write.
* @param size The size in bytes of the data to write.
**/
int write(lua_State *L);
void write(const char *filename, const void *data, int64 size);
/**
* Check if end-of-file is reached.