-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
604 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#pragma once | ||
|
||
#include "modules/filesystem/File.tcc" | ||
|
||
namespace love | ||
{ | ||
class NativeFile : public FileBase | ||
{ | ||
public: | ||
NativeFile(const std::string& filename, Mode mode); | ||
|
||
virtual ~NativeFile(); | ||
|
||
NativeFile* clone() const override; | ||
|
||
int64_t read(void* destination, int64_t size) override; | ||
|
||
bool write(const void* data, int64_t size) override; | ||
|
||
bool flush() override; | ||
|
||
int64_t getSize() override; | ||
|
||
int64_t tell() override; | ||
|
||
bool seek(int64_t position, SeekOrigin origin) override; | ||
|
||
using FileBase::read; | ||
using FileBase::write; | ||
|
||
bool open(Mode mode) override; | ||
|
||
bool close() override; | ||
|
||
bool isOpen() const override; | ||
|
||
bool isEOF() override; | ||
|
||
bool setBuffer(BufferMode bufferMode, int64_t size) override; | ||
|
||
BufferMode getBuffer(int64_t& size) const override; | ||
|
||
const std::string& getFilename() const override; | ||
|
||
private: | ||
NativeFile(const NativeFile& other); | ||
static const char* getModeString(Mode mode); | ||
|
||
FILE* file; | ||
}; | ||
} // namespace love |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
|
||
#include "common/luax.hpp" | ||
#include "modules/filesystem/NativeFile.hpp" | ||
|
||
namespace love | ||
{ | ||
int open_nativefile(lua_State* L); | ||
} // namespace love |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.