Add support for packed clients (#802)

* First iteration of pack reader and interface

* Fix memory leak and remove logs

* Complete packed asset interface and begin on file loading replacement

* Implement proper BinaryIO error

* Improve AssetMemoryBuffer for reading and implement more reading

* Repair more file loading code and improve how navmeshes are loaded

* Missing checks implementation

* Revert addition of Manifest class and migration changes

* Resolved all feedback.
This commit is contained in:
Jett
2022-11-01 18:21:26 +00:00
committed by GitHub
parent 971e0fb3b6
commit 4a6f3e44ee
28 changed files with 690 additions and 81 deletions

View File

@@ -10,16 +10,15 @@ namespace BinaryIO {
template<typename T>
std::istream& BinaryRead(std::istream& stream, T& value) {
if (!stream.good())
printf("bla");
if (!stream.good()) throw std::runtime_error("Failed to read from istream.");
return stream.read(reinterpret_cast<char*>(&value), sizeof(T));
}
void WriteString(const std::string& stringToWrite, std::ofstream& outstream);
std::string ReadString(std::ifstream& instream);
std::string ReadString(std::ifstream& instream, size_t size);
std::string ReadWString(std::ifstream& instream);
std::string ReadString(std::istream& instream);
std::string ReadString(std::istream& instream, size_t size);
std::string ReadWString(std::istream& instream);
inline bool DoesFileExist(const std::string& name) {
std::ifstream f(name.c_str());