| 27 | } |
| 28 | |
| 29 | std::string DebugPrint(HierarchyEntry const & entry) |
| 30 | { |
| 31 | auto obj = base::NewJSONObject(); |
| 32 | ToJSONObject(*obj, "id", DebugPrint(entry.m_id)); |
| 33 | if (entry.m_parentId) |
| 34 | ToJSONObject(*obj, "parentId", DebugPrint(*entry.m_parentId)); |
| 35 | ToJSONObject(*obj, "depth", entry.m_depth); |
| 36 | ToJSONObject(*obj, "type", classif().GetReadableObjectName(entry.m_type)); |
| 37 | ToJSONObject(*obj, "name", entry.m_name); |
| 38 | ToJSONObject(*obj, "country", entry.m_country); |
| 39 | |
| 40 | auto center = base::NewJSONObject(); |
| 41 | ToJSONObject(*center, "x", entry.m_center.x); |
| 42 | ToJSONObject(*center, "y", entry.m_center.y); |
| 43 | ToJSONObject(*obj, "center", center); |
| 44 | return DumpToString(obj); |
| 45 | } |
| 46 | |
| 47 | namespace hierarchy |
| 48 | { |
nothing calls this directly
no test coverage detected