- IFC: directly keep a pointer to the class name in STEP::Object. This avoid hacking around with typeid().name(), which yields platform-dependent results.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@992 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
aramis_acg
2011-05-08 20:08:28 +00:00
parent 27ee419355
commit 95e0148f95
5 changed files with 420 additions and 421 deletions

View File

@@ -431,6 +431,8 @@ namespace STEP {
public:
virtual ~Object() {}
Object(const char* classname = "unknown")
: classname(classname) {}
public:
@@ -463,11 +465,7 @@ namespace STEP {
}
std::string GetClassName() const {
// XXX this relies on unspecified behaviour - we hijack the name() field of std::type_info
// known to work as intended for only msvc 8, with gcc 4.5 it produces reasonable, but
// 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);
return classname;
}
void SetID(uint64_t newval) {
@@ -476,6 +474,7 @@ namespace STEP {
private:
uint64_t id;
const char* const classname;
};