Back to index

lightning-sunbird  0.9+nobinonly
TypeDesc.h
Go to the documentation of this file.
00001 #ifndef TYPEDESC_H
00002 #define TYPEDESC_H
00003 
00004 class TypeDesc
00005 {
00006 public:
00007     enum Type
00008     {
00009         T_POINTER, // A pointer to something else
00010         T_ARRAY,   // An array of other things
00011         T_VOID,
00012         T_RESULT, // nsresult / HRESULT
00013         T_CHAR,
00014         T_WCHAR,
00015         T_INT8,
00016         T_INT16,
00017         T_INT32,
00018         T_INT64,
00019         T_UINT8,
00020         T_UINT16,
00021         T_UINT32,
00022         T_UINT64,
00023         T_STRING,
00024         T_WSTRING,
00025         T_FLOAT,
00026         T_DOUBLE,
00027         T_BOOL,
00028         T_INTERFACE,
00029         T_OTHER,
00030         T_UNSUPPORTED
00031     };
00032 
00033     Type      mType;
00034     union {
00035         // T_POINTER
00036         TypeDesc *mPtr;
00037         // T_ARRAY
00038         struct {
00039             long mNumElements;
00040             TypeDesc **mElements;
00041         } mArray;
00042         // T_UNSUPPORTED
00043         char *mName;
00044     } mData;
00045 
00046     TypeDesc(ITypeInfo* pti, TYPEDESC* ptdesc);
00047     ~TypeDesc();
00048 
00049        std::string ToXPIDLString();
00050        std::string ToCString();
00051 };
00052 
00053 #endif