Finality Engine
Loading...
Searching...
No Matches
Helpers.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <string_view>
9#include <typeinfo>
10
12{
13 static std::string_view GetCleanClassName(const char* rawName)
14 {
15 std::string_view name(rawName);
16
17 if (name.rfind("class ", 0) == 0) name.remove_prefix(6);
18 else if (name.rfind("struct ", 0) == 0) name.remove_prefix(7);
19 else if (name.rfind("enum ", 0) == 0) name.remove_prefix(5);
20
21 size_t lastNamespace = name.find_last_of("::");
22 if (lastNamespace != std::string_view::npos)
23 {
24 name.remove_prefix(lastNamespace + 1);
25 }
26
27 return name;
28 }
29}
static std::string_view GetCleanClassName(const char *rawName)
Definition Helpers.h:13