MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / needsSlashNormalization

Function needsSlashNormalization

pj_datastore/src/plugin_data_host.cpp:57–59  ·  view source on GitHub ↗

Collapse runs of '/' into a single '/' in a topic/field name. Plugin-supplied names are opaque, but an empty '/'-segment ("//") carries no meaning in the curve hierarchy, so we normalize it here — the one boundary every DataSource/Parser name crosses to become a datastore key — so the stored key, the UI catalog (which reads the descriptor name) and the by-name transform resolver all agree on a sin

Source from the content-addressed store, hash-verified

55// the descriptor name) and the by-name transform resolver all agree on a single slash.
56// Common case (no "//") allocates nothing: callers guard on `needsSlashNormalization`.
57[[nodiscard]] bool needsSlashNormalization(std::string_view name) {
58 return name.find("//") != std::string_view::npos;
59}
60
61// A field also needs work if it starts with '/' (a leading slash would double up at
62// the "topic/field" junction), not just when it has internal "//".

Callers 2

needsFieldNormalizationFunction · 0.85
ensureTopicMethod · 0.85

Calls 1

findMethod · 0.45

Tested by

no test coverage detected