Big refactor, shuffling a lot of files around

This commit is contained in:
2025-11-01 19:51:19 -04:00
parent 99b7d9f49d
commit 62cd94ca78
125 changed files with 4073 additions and 3011 deletions
+38
View File
@@ -0,0 +1,38 @@
#include "string_.h"
#include <algorithm>
namespace anm2ed::util::string
{
std::string to_lower(const std::string& string)
{
std::string transformed = string;
std::ranges::transform(transformed, transformed.begin(), [](const unsigned char c) { return std::tolower(c); });
return transformed;
}
std::string backslash_replace(const std::string& string)
{
std::string transformed = string;
for (char& character : transformed)
if (character == '\\') character = '/';
return transformed;
}
std::string backslash_replace_to_lower(const std::string& string)
{
std::string transformed = string;
transformed = backslash_replace(transformed);
return to_lower(transformed);
}
std::string quote(const std::string& string)
{
return "\"" + string + "\"";
}
bool to_bool(const std::string& string)
{
return to_lower(string) == "true";
}
}