/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/ThirdParty/RmlUi/Source/Core/FileInterface.cpp
41 строка
866 B
C-Core
Updated RmlUi to 6.2 and added some improvements (#1813)
10 фев 2026, 01:19
Не верифицирован
10 фев 2026, 01:19
58e2d41
Код
Авторство
О чём код?
#include "../../Include/RmlUi/Core/FileInterface.h" #include "../../Include/RmlUi/Core/Log.h" namespace Rml { FileInterface::FileInterface() {} FileInterface::~FileInterface() {} size_t FileInterface::Length(FileHandle file) { size_t current_position = Tell(file); Seek(file, 0, SEEK_END); size_t length = Tell(file); Seek(file, (long)current_position, SEEK_SET); return length; } bool FileInterface::LoadFile(const String& path, String& out_data) { FileHandle handle = Open(path); if (!handle) return false; const size_t length = Length(handle); out_data = String(length, 0); const size_t read_length = Read(&out_data[0], length, handle); if (length != read_length) { Log::Message(Log::LT_WARNING, "Could only read %zu of %zu bytes from file %s", read_length, length, path.c_str()); } Close(handle); return true; } } // namespace Rml