MCPcopy Create free account
hub / github.com/comaps/comaps / SerializeRoutePoints

Function SerializeRoutePoints

libs/map/routing_manager.cpp:160–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160string SerializeRoutePoints(vector<RouteMarkData> const & points)
161{
162 ASSERT_GREATER_OR_EQUAL(points.size(), 2, ());
163 auto pointsNode = base::NewJSONArray();
164 for (auto const & p : points)
165 {
166 auto pointNode = base::NewJSONObject();
167 SerializeRoutePoint(pointNode.get(), p);
168 json_array_append_new(pointsNode.get(), pointNode.release());
169 }
170 unique_ptr<char, JSONFreeDeleter> buffer(json_dumps(pointsNode.get(), JSON_COMPACT));
171 return string(buffer.get());
172}
173
174vector<RouteMarkData> DeserializeRoutePoints(string const & data)
175{

Callers 1

SaveRoutePointsMethod · 0.85

Calls 6

NewJSONArrayFunction · 0.85
NewJSONObjectFunction · 0.85
SerializeRoutePointFunction · 0.85
getMethod · 0.65
sizeMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected