diff options
author | Hoà V. DINH <dinh.viet.hoa@gmail.com> | 2014-11-24 23:43:39 -0800 |
---|---|---|
committer | Hoà V. DINH <dinh.viet.hoa@gmail.com> | 2014-11-24 23:43:39 -0800 |
commit | 5041e67cf4ee111e9e5f14a9e06f0a598b3eb9ac (patch) | |
tree | 5cbcf5173986b75b40b9e8cc031bd7cf1153db8e | |
parent | 84a6d66f15d4f2785f46397fdd18ba51f8033540 (diff) |
Fixed className() on win32.
-rw-r--r-- | src/core/basetypes/MCObject.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/basetypes/MCObject.cpp b/src/core/basetypes/MCObject.cpp index 7c1d83bb..fbb7cb68 100644 --- a/src/core/basetypes/MCObject.cpp +++ b/src/core/basetypes/MCObject.cpp @@ -93,6 +93,10 @@ String * Object::className() int status; #ifdef _MSC_VER String * result = String::uniquedStringWithUTF8Characters(typeid(*this).name()); + // typeid(*this).name() will return "class mailcore::Object". Therefore, we'll strip the prefix "class " from it. + if (result->hasPrefix(MCSTR("class "))) { + result = result->substringFromIndex(6); + } #else char * unmangled = abi::__cxa_demangle(typeid(* this).name(), NULL, NULL, &status); String * result = String::uniquedStringWithUTF8Characters(unmangled); |