Stax
Programming language
Loading...
Searching...
No Matches
utils.hpp
Go to the documentation of this file.
1
//
2
// Created by tyler on 8/11/24.
3
//
4
5
#pragma once
6
7
#include <algorithm>
8
#include <string>
9
10
namespace
stax::utils
{
11
12
constexpr
auto
underscorify
(
const
std::string& str) {
13
auto
s = str;
14
std::ranges::replace_if(
15
s, [](
const
char
& c) {
return
!std::isalpha(c); },
'_'
);
16
return
s;
17
}
18
19
}
// namespace stax::utils
20
21
#define GET_MODULE_NAME() \
22
utils::underscorify( \
23
std::filesystem::path(std::source_location::current().file_name()) \
24
.stem())
stax::utils
Definition
utils.hpp:10
stax::utils::underscorify
constexpr auto underscorify(const std::string &str)
Definition
utils.hpp:12
staxlib
include
stax
utils
utils.hpp
Generated by
1.10.0