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

Function to_string_width

libs/base/string_utils.hpp:670–677  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

668// Get string with fixed width. Extra '0' are added at the begining to fit size.
669template <typename T, typename = std::enable_if_t<std::is_integral<T>::value>>
670std::string to_string_width(T l, int width)
671{
672 std::ostringstream ss;
673 if (l < 0)
674 ss << '-';
675 ss << std::setfill('0') << std::setw(width) << std::abs(l);
676 return ss.str();
677}
678
679template <typename IterT1, typename IterT2>
680bool StartsWith(IterT1 beg, IterT1 end, IterT2 begPrefix, IterT2 endPrefix)

Callers 2

UNIT_TESTFunction · 0.85
UTMtoMgrsStrFunction · 0.85

Calls

no outgoing calls

Tested by 1

UNIT_TESTFunction · 0.68