5
#if !defined(__GNUC__) && !defined(_WIN32_WCE)
13
#define SWDYNAMIC_CAST(className, object) (className *)((object)?((object->getClass()->isAssignableFrom(#className))?object:0):0)
16
* Class used for SWDYNAMIC_CAST to save the inheritance order.
18
class SWDLLEXPORT SWClass {
20
const char **descends;
23
SWClass(const char **descends) {
24
this->descends = descends;
27
bool isAssignableFrom(const char *className) const {
28
for (int i = 0; descends[i]; i++) {
29
if (!stricmp(descends[i], className))
36
/** Base class for major Sword classes.
37
* SWObject is the base class for major Sword classes like SWKey.
38
* It is used because dynamic_cast is not available on all plattforms supported
39
* by Sword. Use SWDYNAMIC_CAST(classname, object) instead of dynamic_cast<classname>(object).
46
/** Use this to get the class definition and inheritance order.
47
* @return The class definition of this object
49
const SWClass *getClass () const {