MCPcopy Create free account
hub / github.com/FastLED/FastLED / to_hex

Function to_hex

src/fl/stl/string.h:517–528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515
516template<typename T>
517fl::string to_hex(T value, bool uppercase, bool pad_to_width) FL_NOEXCEPT {
518 constexpr auto width = detail::get_hex_int_width<sizeof(T)>();
519 bool is_negative = false;
520 u64 unsigned_value;
521 if (static_cast<i64>(value) < 0 && sizeof(T) <= 8) {
522 is_negative = true;
523 unsigned_value = static_cast<u64>(-static_cast<i64>(value));
524 } else {
525 unsigned_value = static_cast<u64>(value);
526 }
527 return detail::hex(unsigned_value, width, is_negative, uppercase, pad_to_width);
528}
529
530// Comparator that orders strings by size first, then by content.
531// Not lexicographic — use only for associative containers (flat_map, etc.)

Callers 4

format_argFunction · 0.85
attach_external_handlerFunction · 0.85
attach_external_handlerFunction · 0.85
FL_TEST_FILEFunction · 0.85

Calls 1

hexFunction · 0.85

Tested by

no test coverage detected