Esempio n. 1
0
    std::string get_class_name(lua_State* L, LUABIND_TYPE_INFO i)
    {
        std::string ret;

		assert(L);

		class_registry* r = class_registry::get_registry(L);
        class_rep* crep = r->find_class(i);

        if (crep == 0)
        {
            ret = "custom";
			add_custom_name(i, ret);
        }
        else
        {
            if (LUABIND_TYPE_INFO_EQUAL(i, crep->holder_type()))
            {
                ret += "smart_ptr<";
                ret += crep->name();
                ret += ">";
            }
            else if (LUABIND_TYPE_INFO_EQUAL(i, crep->const_holder_type()))
            {
                ret += "smart_ptr<const ";
                ret += crep->name();
                ret += ">";
            }
            else
            {
                ret += crep->name();
            }
        }
        return ret;
    };
Esempio n. 2
0
    std::string get_class_name(lua_State* L, type_id const& i)
    {
        std::string ret;

		assert(L);

		class_registry* r = class_registry::get_registry(L);
        class_rep* crep = r->find_class(i);

        if (crep == 0)
        {
            ret = "custom";
			add_custom_name(i, ret);
        }
        else
        {
            /* TODO reimplement this?
            if (i == crep->holder_type())
            {
                ret += "smart_ptr<";
                ret += crep->name();
                ret += ">";
            }
            else if (i == crep->const_holder_type())
            {
                ret += "smart_ptr<const ";
                ret += crep->name();
                ret += ">";
            }
            else*/
            {
                ret += crep->name();
            }
        }
        return ret;
    }