class Paludis::URILabel

URI label base class.

Public Instance Methods

text → String click to toggle source

Our text.

VALUE
    uri_label_text(VALUE self)
    {
        std::shared_ptr<const URILabel> * ptr;
        Data_Get_Struct(self, std::shared_ptr<const URILabel>, ptr);
        return rb_str_new2((*ptr)->text().c_str());
    }

    struct DependenciesLabelToValue
    {
        VALUE value;
        std::shared_ptr<const DependenciesLabel> mm;

        DependenciesLabelToValue(const std::shared_ptr<const DependenciesLabel> & _m) :
            mm(_m)
        {
        }

        void visit(const DependenciesBuildLabel &)
        {
            value = Data_Wrap_Struct(c_dependencies_build_label, 0, &Common<std::shared_ptr<const DependenciesLabel> >::free,
                    new std::shared_ptr<const DependenciesLabel>(mm));
        }

        void visit(const DependenciesTestLabel &)
        {
            value = Data_Wrap_Struct(c_dependencies_test_label, 0, &Common<std::shared_ptr<const DependenciesLabel> >::free,
                    new std::shared_ptr<const DependenciesLabel>(mm));
        }

        void visit(const DependenciesRunLabel &)
        {
            value = Data_Wrap_Struct(c_dependencies_run_label, 0, &Common<std::shared_ptr<const DependenciesLabel> >::free,
                    new std::shared_ptr<const DependenciesLabel>(mm));
        }

        void visit(const DependenciesPostLabel &)
        {
            value = Data_Wrap_Struct(c_dependencies_post_label, 0, &Common<std::shared_ptr<const DependenciesLabel> >::free,
                    new std::shared_ptr<const DependenciesLabel>(mm));
        }

        void visit(const DependenciesInstallLabel &)
        {
            value = Data_Wrap_Struct(c_dependencies_install_label, 0, &Common<std::shared_ptr<const DependenciesLabel> >::free,
                    new std::shared_ptr<const DependenciesLabel>(mm));
        }

        void visit(const DependenciesFetchLabel &)
        {
            value = Data_Wrap_Struct(c_dependencies_fetch_label, 0, &Common<std::shared_ptr<const DependenciesLabel> >::free,
                    new std::shared_ptr<const DependenciesLabel>(mm));
        }

        void visit(const DependenciesSuggestionLabel &)
        {
            value = Data_Wrap_Struct(c_dependencies_suggestion_label, 0, &Common<std::shared_ptr<const DependenciesLabel> >::free,
                    new std::shared_ptr<const DependenciesLabel>(mm));
        }

        void visit(const DependenciesRecommendationLabel &)
        {
            value = Data_Wrap_Struct(c_dependencies_recommendation_label, 0, &Common<std::shared_ptr<const DependenciesLabel> >::free,
                    new std::shared_ptr<const DependenciesLabel>(mm));
        }

        void visit(const DependenciesCompileAgainstLabel &)
        {
            value = Data_Wrap_Struct(c_dependencies_compile_against_label, 0, &Common<std::shared_ptr<const DependenciesLabel> >::free,
                    new std::shared_ptr<const DependenciesLabel>(mm));
        }
    };

    /*
     * Document-method: text
     *
     * call-seq:
     *     text -> String
     *
     * Our text.
     */
    /*
     * Document-method: to_s
     *
     * call-seq:
     *     to_s -> String
     *
     * Fetch a string representation of ourself.
     */
    VALUE
    dependencies_label_text(VALUE self)
    {
        std::shared_ptr<const DependenciesLabel> * ptr;
        Data_Get_Struct(self, std::shared_ptr<const DependenciesLabel>, ptr);
        return rb_str_new2((*ptr)->text().c_str());
    }

    void do_register_dep_label()
    {
        /*
         * Document-class: Paludis::URILabel
         *
         * URI label base class.
         */
        c_uri_label = rb_define_class_under(c_paludis_module, "URILabel", rb_cObject);
        rb_funcall(c_uri_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
        rb_define_method(c_uri_label, "text", uri_label_text, 0);
        rb_define_method(c_uri_label, "to_s", uri_label_text, 0);

        c_uri_mirrors_then_listed_label = rb_define_class_under(c_paludis_module, "URIMirrorsThenListedLabel", c_uri_label);
        c_uri_mirrors_only_label = rb_define_class_under(c_paludis_module, "URIMirrorsOnlyLabel", c_uri_label);
        c_uri_listed_only_label = rb_define_class_under(c_paludis_module, "URIListedOnlyLabel", c_uri_label);
        c_uri_listed_then_mirrors_label = rb_define_class_under(c_paludis_module, "URIListedThenMirrorsLabel", c_uri_label);
        c_uri_local_mirrors_only_label = rb_define_class_under(c_paludis_module, "URILocalMirrorsOnlyLabel", c_uri_label);
        c_uri_manual_only_label = rb_define_class_under(c_paludis_module, "URIManualOnlyLabel", c_uri_label);

        /*
         * Document-class: Paludis::DependenciesLabel
         *
         * Dependencies label base class.
         */
        c_dependencies_label = rb_define_class_under(c_paludis_module, "DependenciesLabel", rb_cObject);
        rb_funcall(c_dependencies_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
        rb_define_method(c_dependencies_label, "text", dependencies_label_text, 0);
        rb_define_method(c_dependencies_label, "to_s", dependencies_label_text, 0);

        c_dependencies_build_label = rb_define_class_under(c_paludis_module, "DependenciesBuildLabel", c_dependencies_label);
        c_dependencies_test_label = rb_define_class_under(c_paludis_module, "DependenciesTestLabel", c_dependencies_label);
        c_dependencies_run_label = rb_define_class_under(c_paludis_module, "DependenciesRunLabel", c_dependencies_label);
        c_dependencies_post_label = rb_define_class_under(c_paludis_module, "DependenciesPostLabel", c_dependencies_label);
        c_dependencies_install_label = rb_define_class_under(c_paludis_module, "DependenciesInstallLabel", c_dependencies_label);
        c_dependencies_compile_against_label = rb_define_class_under(c_paludis_module, "DependenciesCompileAgainstLabel", c_dependencies_label);
        c_dependencies_fetch_label = rb_define_class_under(c_paludis_module, "DependenciesFetchLabel", c_dependencies_label);
        c_dependencies_suggestion_label = rb_define_class_under(c_paludis_module, "DependenciesSuggestionLabel", c_dependencies_label);
        c_dependencies_recommendation_label = rb_define_class_under(c_paludis_module, "DependenciesRecommendationLabel", c_dependencies_label);

    }
}
to_s → String click to toggle source

Fetch a string representation of ourself.

VALUE
    uri_label_text(VALUE self)
    {
        std::shared_ptr<const URILabel> * ptr;
        Data_Get_Struct(self, std::shared_ptr<const URILabel>, ptr);
        return rb_str_new2((*ptr)->text().c_str());
    }

    struct DependenciesLabelToValue
    {
        VALUE value;
        std::shared_ptr<const DependenciesLabel> mm;

        DependenciesLabelToValue(const std::shared_ptr<const DependenciesLabel> & _m) :
            mm(_m)
        {
        }

        void visit(const DependenciesBuildLabel &)
        {
            value = Data_Wrap_Struct(c_dependencies_build_label, 0, &Common<std::shared_ptr<const DependenciesLabel> >::free,
                    new std::shared_ptr<const DependenciesLabel>(mm));
        }

        void visit(const DependenciesTestLabel &)
        {
            value = Data_Wrap_Struct(c_dependencies_test_label, 0, &Common<std::shared_ptr<const DependenciesLabel> >::free,
                    new std::shared_ptr<const DependenciesLabel>(mm));
        }

        void visit(const DependenciesRunLabel &)
        {
            value = Data_Wrap_Struct(c_dependencies_run_label, 0, &Common<std::shared_ptr<const DependenciesLabel> >::free,
                    new std::shared_ptr<const DependenciesLabel>(mm));
        }

        void visit(const DependenciesPostLabel &)
        {
            value = Data_Wrap_Struct(c_dependencies_post_label, 0, &Common<std::shared_ptr<const DependenciesLabel> >::free,
                    new std::shared_ptr<const DependenciesLabel>(mm));
        }

        void visit(const DependenciesInstallLabel &)
        {
            value = Data_Wrap_Struct(c_dependencies_install_label, 0, &Common<std::shared_ptr<const DependenciesLabel> >::free,
                    new std::shared_ptr<const DependenciesLabel>(mm));
        }

        void visit(const DependenciesFetchLabel &)
        {
            value = Data_Wrap_Struct(c_dependencies_fetch_label, 0, &Common<std::shared_ptr<const DependenciesLabel> >::free,
                    new std::shared_ptr<const DependenciesLabel>(mm));
        }

        void visit(const DependenciesSuggestionLabel &)
        {
            value = Data_Wrap_Struct(c_dependencies_suggestion_label, 0, &Common<std::shared_ptr<const DependenciesLabel> >::free,
                    new std::shared_ptr<const DependenciesLabel>(mm));
        }

        void visit(const DependenciesRecommendationLabel &)
        {
            value = Data_Wrap_Struct(c_dependencies_recommendation_label, 0, &Common<std::shared_ptr<const DependenciesLabel> >::free,
                    new std::shared_ptr<const DependenciesLabel>(mm));
        }

        void visit(const DependenciesCompileAgainstLabel &)
        {
            value = Data_Wrap_Struct(c_dependencies_compile_against_label, 0, &Common<std::shared_ptr<const DependenciesLabel> >::free,
                    new std::shared_ptr<const DependenciesLabel>(mm));
        }
    };

    /*
     * Document-method: text
     *
     * call-seq:
     *     text -> String
     *
     * Our text.
     */
    /*
     * Document-method: to_s
     *
     * call-seq:
     *     to_s -> String
     *
     * Fetch a string representation of ourself.
     */
    VALUE
    dependencies_label_text(VALUE self)
    {
        std::shared_ptr<const DependenciesLabel> * ptr;
        Data_Get_Struct(self, std::shared_ptr<const DependenciesLabel>, ptr);
        return rb_str_new2((*ptr)->text().c_str());
    }

    void do_register_dep_label()
    {
        /*
         * Document-class: Paludis::URILabel
         *
         * URI label base class.
         */
        c_uri_label = rb_define_class_under(c_paludis_module, "URILabel", rb_cObject);
        rb_funcall(c_uri_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
        rb_define_method(c_uri_label, "text", uri_label_text, 0);
        rb_define_method(c_uri_label, "to_s", uri_label_text, 0);

        c_uri_mirrors_then_listed_label = rb_define_class_under(c_paludis_module, "URIMirrorsThenListedLabel", c_uri_label);
        c_uri_mirrors_only_label = rb_define_class_under(c_paludis_module, "URIMirrorsOnlyLabel", c_uri_label);
        c_uri_listed_only_label = rb_define_class_under(c_paludis_module, "URIListedOnlyLabel", c_uri_label);
        c_uri_listed_then_mirrors_label = rb_define_class_under(c_paludis_module, "URIListedThenMirrorsLabel", c_uri_label);
        c_uri_local_mirrors_only_label = rb_define_class_under(c_paludis_module, "URILocalMirrorsOnlyLabel", c_uri_label);
        c_uri_manual_only_label = rb_define_class_under(c_paludis_module, "URIManualOnlyLabel", c_uri_label);

        /*
         * Document-class: Paludis::DependenciesLabel
         *
         * Dependencies label base class.
         */
        c_dependencies_label = rb_define_class_under(c_paludis_module, "DependenciesLabel", rb_cObject);
        rb_funcall(c_dependencies_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
        rb_define_method(c_dependencies_label, "text", dependencies_label_text, 0);
        rb_define_method(c_dependencies_label, "to_s", dependencies_label_text, 0);

        c_dependencies_build_label = rb_define_class_under(c_paludis_module, "DependenciesBuildLabel", c_dependencies_label);
        c_dependencies_test_label = rb_define_class_under(c_paludis_module, "DependenciesTestLabel", c_dependencies_label);
        c_dependencies_run_label = rb_define_class_under(c_paludis_module, "DependenciesRunLabel", c_dependencies_label);
        c_dependencies_post_label = rb_define_class_under(c_paludis_module, "DependenciesPostLabel", c_dependencies_label);
        c_dependencies_install_label = rb_define_class_under(c_paludis_module, "DependenciesInstallLabel", c_dependencies_label);
        c_dependencies_compile_against_label = rb_define_class_under(c_paludis_module, "DependenciesCompileAgainstLabel", c_dependencies_label);
        c_dependencies_fetch_label = rb_define_class_under(c_paludis_module, "DependenciesFetchLabel", c_dependencies_label);
        c_dependencies_suggestion_label = rb_define_class_under(c_paludis_module, "DependenciesSuggestionLabel", c_dependencies_label);
        c_dependencies_recommendation_label = rb_define_class_under(c_paludis_module, "DependenciesRecommendationLabel", c_dependencies_label);

    }
}