cgv
Loading...
Searching...
No Matches
type_name.cxx
1#include "type_name.h"
2#include <cgv/utils/scan.h>
3namespace cgv {
4 namespace type {
6 namespace info {
7
9std::string extract_type_name(const std::type_info& ti)
10{
11 std::string res(ti.name());
12 cgv::utils::replace(res, "class ", "");
13 cgv::utils::replace(res, "struct ", "");
14 cgv::utils::replace(res, "union ", "");
15 cgv::utils::replace(res, "enum ", "");
16 return res;
17}
18
19
20 }
21 }
22}
std::string extract_type_name(const std::type_info &ti)
extract a type name from an type_info structure that does not contain the class, struct nor enum keyw...
Definition type_name.cxx:9
unsigned int replace(std::string &s, char c1, char c2)
replace char c1 with c2 in the given string _s and return number of replacements
Definition scan.cxx:159
the cgv namespace
Definition print.h:11
Helper functions to process strings.