Ejemplo n.º 1
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 || !crep->name())
        {
            ret = crep ? "unnamed [" : "custom [";
            ret += i.name();
            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;
    }
Ejemplo n.º 2
0
	void add_custom_name(type_id const& i, std::string& s)
	{
		s += " [";
		s += i.name();
		s += "]";
	}