8#ifndef SEN_CORE_BASE_SOURCE_LOCATION_H
9#define SEN_CORE_BASE_SOURCE_LOCATION_H
20constexpr size_t getFilenameOffset(
const std::string_view str)
noexcept
22 const size_t pos = str.find_last_of(
"/\\");
23 return pos == std::string_view::npos ? 0 : pos + 1;
27template <
typename T, T v>
30 static constexpr const T value = v;
35#define SEN_SL_CONSTEXPR_VAL(exp) ::sen::impl::ConstexprValue<decltype(exp), exp>::value
48 std::string_view
fileName {
"file name not set"};
54# define SEN_PRETTY_FUNCTION_NAME __FUNCSIG__
56# define SEN_PRETTY_FUNCTION_NAME __PRETTY_FUNCTION__
62 ::sen::SourceLocation \
64 std::string_view {&__FILE__[SEN_SL_CONSTEXPR_VAL(::sen::impl::getFilenameOffset(__FILE__))]}, __LINE__, \
65 std::string_view(SEN_PRETTY_FUNCTION_NAME) \
std::string_view fileName
Definition source_location.h:48
std::string_view functionName
Definition source_location.h:50
int lineNumber
Definition source_location.h:49
Represents a location in source code.
Definition source_location.h:47