18 std::filesystem::perms::owner_read | std::filesystem::perms::owner_write |
19 std::filesystem::perms::group_read | std::filesystem::perms::others_read;
20 std::error_code error;
21 std::filesystem::permissions(p, permissions, error);
23 std::cerr <<
"Failed to set access on file '" << p
24 <<
"': " << error.message() << std::endl;
31 return reinterpret_cast<const char*
>(path.u8string().c_str());
35 auto p = std::filesystem::path{path}.stem();
44 std::stringstream stream;
45 bool next_upper =
true;
46 for (
size_t i = 0, count =
string.length(); i < count; i++) {
47 auto ch =
string.data()[i];
50 stream << static_cast<char>(std::toupper(ch));
63 std::string result = std::string(
string);
64 std::transform(result.begin(), result.end(), result.begin(),
65 [](
char x) { return std::tolower(x); });
73 std::stringstream stream;
75 if (!std::isalpha(
string.data()[0])) {
78 for (
size_t i = 0, count =
string.length(); i < count; i++) {
79 auto ch =
string.data()[i];
80 if (std::isalnum(ch) || ch ==
'_') {
88 if (prefix.length() > target.length()) {
91 for (
size_t i = 0; i < prefix.length(); i++) {
92 if (target[i] != prefix[i]) {