STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
fsw::script::anonymous_namespace{Validate.cpp} Namespace Reference

Functions

std::string nearest (const std::string &want, const std::map< std::string, std::string > &table)
 A short "did you mean" for a slug that did not resolve.
std::string suffixFor (const std::string &want, const std::map< std::string, std::string > &table)

Function Documentation

◆ nearest()

std::string fsw::script::anonymous_namespace{Validate.cpp}::nearest ( const std::string & want,
const std::map< std::string, std::string > & table )

A short "did you mean" for a slug that did not resolve.

Cheap edit-distance-1-ish: same length with one character different, or a one-character insertion/deletion. Enough to catch the real typo (FUEL_VNT for FUEL_VENT) without pretending to be a spell checker.

Definition at line 13 of file Validate.cpp.

References a, b, diff(), and nearest().

Referenced by nearest(), and suffixFor().

◆ suffixFor()

std::string fsw::script::anonymous_namespace{Validate.cpp}::suffixFor ( const std::string & want,
const std::map< std::string, std::string > & table )

Definition at line 48 of file Validate.cpp.

References table::empty(), near(), nearest(), and suffixFor().

Referenced by suffixFor().