# fix crashbug in rtrim(), hackpatch STEP::Object::GetClassName() for gcc
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@990 67173fc5-114c-0410-ac8e-9d2fd5bffc1fpull/1/head
parent
a283c2ef91
commit
27ee419355
|
@ -463,9 +463,11 @@ namespace STEP {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GetClassName() const {
|
std::string GetClassName() const {
|
||||||
// strictly speaking this relies on unspecified behaviour - we hijack the name() field of std::type_info
|
// XXX this relies on unspecified behaviour - we hijack the name() field of std::type_info
|
||||||
const char* s = typeid(*this).name(), *s2 = strstr(s,"IFC::");
|
// known to work as intended for only msvc 8, with gcc 4.5 it produces reasonable, but
|
||||||
return std::string(s2?s2+5:s);
|
// not totally unmangled output - we definitely need a traits-based solution here.
|
||||||
|
const char* s = typeid(*this).name(), *s2 = strstr(s,"Ifc");
|
||||||
|
return std::string(s2?s2:s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetID(uint64_t newval) {
|
void SetID(uint64_t newval) {
|
||||||
|
|
|
@ -63,7 +63,7 @@ static inline std::string <rim(std::string &s) {
|
||||||
|
|
||||||
// trim from end
|
// trim from end
|
||||||
static inline std::string &rtrim(std::string &s) {
|
static inline std::string &rtrim(std::string &s) {
|
||||||
s.erase(std::find_if(s.rbegin(), s.rend(), std::not1( std::ptr_fun(Assimp::IsSpace<char>))).base());
|
s.erase(std::find_if(s.rbegin(), s.rend(), std::not1( std::ptr_fun(Assimp::IsSpace<char>))).base(),s.end());
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
// trim from both ends
|
// trim from both ends
|
||||||
|
|
Loading…
Reference in New Issue