engine/include/util/files.h
2023-05-01 14:13:35 +01:00

22 lines
645 B
C++

#ifndef ENGINE_INCLUDE_UTIL_FILES_H_
#define ENGINE_INCLUDE_UTIL_FILES_H_
#include <memory>
#include <string>
#include <vector>
namespace engine {
namespace util {
std::unique_ptr<std::vector<char>> ReadTextFile(const std::string& path);
std::unique_ptr<std::vector<uint8_t>> ReadBinaryFile(const std::string& path);
// Read an image file into a vector byte buffer. PNG and JPG support at a
// minimum. Output format is R8G8B8A8_UINT
std::unique_ptr<std::vector<uint8_t>> ReadImageFile(const std::string& path,
int* width, int* height);
} // namespace util
} // namespace engine
#endif