2017-07-06 03:27:25 +00:00
|
|
|
#pragma once
|
|
|
|
#include <string>
|
2017-08-05 13:09:50 +00:00
|
|
|
#include <fnd/MemoryBlob.h>
|
2017-07-06 03:27:25 +00:00
|
|
|
|
|
|
|
namespace fnd
|
|
|
|
{
|
|
|
|
namespace io
|
|
|
|
{
|
2018-04-25 12:27:18 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
const std::string kPathDivider = "\\";
|
|
|
|
#else
|
|
|
|
const std::string kPathDivider = "/";
|
|
|
|
#endif
|
|
|
|
|
2018-04-15 02:36:43 +00:00
|
|
|
size_t getFileSize(const std::string& path);
|
2017-07-06 03:27:25 +00:00
|
|
|
void readFile(const std::string& path, MemoryBlob& blob);
|
2018-03-25 11:52:56 +00:00
|
|
|
void readFile(const std::string& path, size_t offset, size_t len, MemoryBlob& blob);
|
2017-07-06 03:27:25 +00:00
|
|
|
void writeFile(const std::string& path, const MemoryBlob& blob);
|
2018-03-22 05:26:22 +00:00
|
|
|
void writeFile(const std::string& path, const byte_t* data, size_t len);
|
2018-04-15 06:00:46 +00:00
|
|
|
void makeDirectory(const std::string& path);
|
2018-04-25 04:59:42 +00:00
|
|
|
void getEnvironVar(std::string& var, const std::string& key);
|
2018-04-25 12:27:18 +00:00
|
|
|
void appendToPath(std::string& base, const std::string& add);
|
2017-07-06 03:27:25 +00:00
|
|
|
}
|
|
|
|
}
|