migrate from std::filesystem::path to io::path (WIP)

This commit is contained in:
MihailRis
2025-01-30 22:23:13 +03:00
parent 1e22882284
commit e0314803c0
72 changed files with 1189 additions and 791 deletions
+4 -7
View File
@@ -6,12 +6,9 @@
#include <utility>
#include "io/engine_paths.hpp"
#include "io/io.hpp"
#include "typedefs.hpp"
#include "util/stringutil.hpp"
namespace fs = std::filesystem;
void GLSLExtension::setVersion(std::string version) {
this->version = std::move(version);
}
@@ -21,7 +18,7 @@ void GLSLExtension::setPaths(const ResPaths* paths) {
}
void GLSLExtension::loadHeader(const std::string& name) {
fs::path file = paths->find("shaders/lib/" + name + ".glsl");
io::path file = paths->find("shaders/lib/" + name + ".glsl");
std::string source = io::read_string(file);
addHeader(name, "");
addHeader(name, process(file, source, true));
@@ -66,7 +63,7 @@ void GLSLExtension::undefine(const std::string& name) {
}
inline std::runtime_error parsing_error(
const fs::path& file, uint linenum, const std::string& message
const io::path& file, uint linenum, const std::string& message
) {
return std::runtime_error(
"file " + file.string() + ": " + message + " at line " +
@@ -75,7 +72,7 @@ inline std::runtime_error parsing_error(
}
inline void parsing_warning(
const fs::path& file, uint linenum, const std::string& message
const io::path& file, uint linenum, const std::string& message
) {
std::cerr << "file " + file.string() + ": warning: " + message +
" at line " + std::to_string(linenum)
@@ -87,7 +84,7 @@ inline void source_line(std::stringstream& ss, uint linenum) {
}
std::string GLSLExtension::process(
const fs::path& file, const std::string& source, bool header
const io::path& file, const std::string& source, bool header
) {
std::stringstream ss;
size_t pos = 0;