Beispiel #1
0
    void
    operator()(const dynamic_t::object_t& v) {
        ++m_objects;

        for (auto it = v.begin(); it != v.end(); ++it) {
            it->second.apply(*this);
        }
    }
Beispiel #2
0
    std::string
    operator()(const dynamic_t::object_t& v) const {
        std::string result = "{";

        dynamic_t::object_t::const_iterator it = v.begin();

        if(it != v.end()) {
            result += "\"" + it->first + "\":" + it->second.apply(*this);
            ++it;
        }

        for(; it != v.end(); ++it) {
            result += ", ";
            result += "\"" + it->first + "\":" + it->second.apply(*this);
        }

        return result + "}";
    }
Beispiel #3
0
    void
    operator()(const dynamic_t::object_t& v) const {
        std::cout << "{" << std::endl;

        bool print_coma = false;
        for(auto it = v.begin(); it != v.end(); ++it) {
            if (print_coma) {
                std::cout << "," << std::endl;
            }
            std::cout << std::string(2 * (m_indent + 1), ' ') << "'" << it->first << "': ";
            it->second.apply(print_visitor(m_indent + 1));
            print_coma = true;
        }

        std::cout << std::endl << std::string(2 * m_indent, ' ') << "}";
    }