#pragma once
#include "JSONWrapper.hpp"
#include <functional>
#include <string>
using namespace std;
string join(JSONObject::const_iterator first, JSONObject::const_iterator last, string delimitor,
std::function<string(const JSONObject::value_type&)> func)
{
string ret = "";
for (;first!= last; first++)
{
ret += func(*first) + delimitor;
}
return ret;
}
string join(JSONArray::const_iterator first, JSONArray::const_iterator last, string delimitor,
std::function<string(const JSONValue&)> func)
{
string ret = "";
for (;first!= last; first++)
{
ret += func(*first) + delimitor;
}
return ret;
}
Saturday, December 3, 2016
join.cpp on iterator though vector and map
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment