VoxelEngine/src/files/util.hpp
2024-08-14 17:12:12 +03:00

17 lines
367 B
C++

#pragma once
#include <string>
#include <stdexcept>
namespace files {
inline bool is_valid_name(std::string_view name) {
static std::string illegalChars = "\\/%?!<>:; ";
for (char c : illegalChars) {
if (name.find(c) != std::string::npos) {
return false;
}
}
return !name.empty();
}
}