[BASESRV]
[reactos.git] / include / c++ / typeinfo
index 39bc51a..43dbb26 100644 (file)
@@ -1,48 +1,65 @@
-// RTTI support for C++
-
-#ifndef _TYPEINFO
-#define _TYPEINFO
-
-#include <exception>
-
-extern "C++" {
-
-namespace std 
-{
-
-    class type_info {
-    public:
-        virtual ~type_info();
-        bool before (const type_info& rhs) const;
-            { return __name < __arg.__name; }
-        bool operator==(const type_info& __arg) const
-            { return __name == __arg.__name; }
-        bool operator!=(const type_info& __arg) const
-            { return !operator==(__arg); }
-        const char* name() const;
-    protected:
-        const char* __name;
-    private:
-        type_info (const type_info& rhs);
-        type_info& operator= (const type_info& rhs);
-    };
-
-    class bad_cast : public exception 
-    {
-    public:
-        bad_cast() throw() { }
-        virtual ~bad_cast() throw();
-        virtual const char* what() const throw();
-    };
-  
-    class bad_typeid : public exception 
-    {
-    public:
-        bad_typeid () throw() { }
-        virtual ~bad_typeid() throw();
-        virtual const char* what() const throw();
-    };
-} // namespace std
-
-} // extern "C++"
-#endif
+// RTTI support for C++\r
+\r
+#ifndef _TYPEINFO\r
+#define _TYPEINFO\r
+\r
+#include <exception>\r
+\r
+extern "C++" {\r
+\r
+class type_info {\r
+public:\r
+    virtual ~type_info();\r
+\r
+    int before(const type_info &) const;\r
+    const char *name() const;\r
+    const char *raw_name() const;\r
+\r
+    int operator==(const type_info &) const;\r
+    int operator!=(const type_info &) const;\r
+private:\r
+    char *_name;\r
+    char _mangled[32];\r
+\r
+    type_info(const type_info &);\r
+    type_info &operator=(const type_info &);\r
+};\r
+\r
+class bad_cast : public exception\r
+{\r
+public:\r
+    bad_cast(const char *name = "bad cast") throw()\r
+        : exception(name) { }\r
+    bad_cast(const char * const *) throw();\r
+    bad_cast(const char * const &) throw();\r
+\r
+    virtual ~bad_cast() throw() { }\r
+};\r
+\r
+class bad_typeid : public exception\r
+{\r
+public:\r
+    bad_typeid(const char *name = "bad typeid") throw()\r
+        : exception(name) { }\r
+\r
+    virtual ~bad_typeid() throw() { }\r
+};\r
+\r
+class __non_rtti_object : public bad_typeid\r
+{\r
+public:\r
+    __non_rtti_object(const char *name) throw()\r
+        : bad_typeid(name) { }\r
+\r
+    virtual ~__non_rtti_object() throw() { }\r
+};\r
+\r
+namespace std\r
+{\r
+    using ::type_info;\r
+    using ::bad_cast;\r
+    using ::bad_typeid;\r
+} // namespace std\r
+\r
+} // extern "C++"\r
+#endif\r