MCPcopy Create free account
hub / github.com/computationalpathologygroup/ASAP / inttohex

Function inttohex

core/stringconversion.h:143–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141// Converts an integer type to a string in hexidecimal notation.
142// Width can be set but defaults to 6.
143 template <typename T> inline std::string inttohex(T i, int width = 6)
144 {
145 std::string s;
146 std::stringstream str;
147 str << std::hex << std::showbase << std::internal << std::setfill('0') << std::setw(width) << i;
148 str >> s;
149
150 //alternative:
151 //String str = AnsiString::IntToHex(i,6);
152 //s = str.c_str();
153
154 return s;
155 }
156
157 // NOTE: Below is deprecated in C17, but valid until a replacement is introduced
158 std::wstring CORE_EXPORT stringToWideString(const std::string& string);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected