Exemple #1
0
static void writeEntry(json_stream& str, const std::string& key, JSONObject::JSONMap& map, WriteVisitor& visitor)
{
    if (key.empty())
        return;

    JSONObject::JSONMap::iterator keyValue = map.find(key);
    if ( keyValue != map.end() && keyValue->second.valid() ) {

        str << JSONObjectBase::indent() << '"' << key << '"' << ": ";
        keyValue->second->write(str, visitor);
        map.erase(keyValue);

        if (!map.empty()) {
            str << ",\n";
        }
    }
}
Exemple #2
0
static void writeEntry(std::ostream& str, const std::string& key, JSONObject::JSONMap& map, WriteVisitor& visitor)
{
    if (key.empty())
        return;

    if ( map.find(key) != map.end() &&
         map[ key ].valid() ) {
        
        str << JSONObjectBase::indent() << '"' << key << '"' << ": ";
        map[ key ]->write(str, visitor);
        map.erase(key);

        if (!map.empty()) {
            str << ", ";
            str << "\n";
        }
    }
}