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

Method ToString

libs/indexer/edit_journal.cpp:84–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84std::string EditJournal::ToString(osm::JournalEntry const & journalEntry)
85{
86 switch (journalEntry.journalEntryType)
87 {
88 case osm::JournalEntryType::TagModification:
89 {
90 TagModData const & tagModData = std::get<TagModData>(journalEntry.data);
91 return ToString(journalEntry.journalEntryType)
92 .append(": Key ")
93 .append(tagModData.key)
94 .append(" changed from \"")
95 .append(tagModData.old_value)
96 .append("\" to \"")
97 .append(tagModData.new_value)
98 .append("\"");
99 }
100 case osm::JournalEntryType::ObjectCreated:
101 {
102 ObjCreateData const & objCreatedData = std::get<ObjCreateData>(journalEntry.data);
103 return ToString(journalEntry.journalEntryType)
104 .append(": ")
105 .append(classif().GetReadableObjectName(objCreatedData.type))
106 .append(" (")
107 .append(std::to_string(objCreatedData.type))
108 .append(")");
109 }
110 case osm::JournalEntryType::LegacyObject:
111 {
112 LegacyObjData const & legacyObjData = std::get<LegacyObjData>(journalEntry.data);
113 return ToString(journalEntry.journalEntryType).append(": version=\"").append(legacyObjData.version).append("\"");
114 }
115 case osm::JournalEntryType::BusinessReplacement:
116 {
117 BusinessReplacementData const & businessReplacementData = std::get<BusinessReplacementData>(journalEntry.data);
118 return ToString(journalEntry.journalEntryType)
119 .append(": Category changed from ")
120 .append(classif().GetReadableObjectName(businessReplacementData.old_type))
121 .append(" to ")
122 .append(classif().GetReadableObjectName(businessReplacementData.new_type));
123 }
124 default: UNREACHABLE();
125 }
126}
127
128std::string EditJournal::ToString(osm::JournalEntryType journalEntryType)
129{

Callers

nothing calls this directly

Calls 4

to_stringFunction · 0.85
GetReadableObjectNameMethod · 0.80
ToStringFunction · 0.70
appendMethod · 0.45

Tested by

no test coverage detected