Minimized region files reopen
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
#include <filesystem>
|
||||
#include "../typedefs.h"
|
||||
|
||||
@@ -11,6 +12,19 @@ namespace json {
|
||||
}
|
||||
|
||||
namespace files {
|
||||
/* Read-only random access file */
|
||||
class rafile {
|
||||
std::ifstream file;
|
||||
size_t filelength;
|
||||
public:
|
||||
rafile(std::filesystem::path filename);
|
||||
|
||||
void seekg(std::streampos pos);
|
||||
void read(char* buffer, std::streamsize size);
|
||||
size_t length() const;
|
||||
};
|
||||
|
||||
|
||||
extern bool write_bytes(std::filesystem::path, const char* data, size_t size);
|
||||
extern uint append_bytes(std::filesystem::path, const char* data, size_t size);
|
||||
extern bool read(std::filesystem::path, char* data, size_t size);
|
||||
|
||||
Reference in New Issue
Block a user