MCPcopy Create free account
hub / github.com/c42f/tinyformat / formatTruncated

Function formatTruncated

tinyformat.h:279–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277// Format at most ntrunc characters to the given stream.
278template<typename T>
279inline void formatTruncated(std::ostream& out, const T& value, int ntrunc)
280{
281 std::ostringstream tmp;
282 tmp << value;
283 std::string result = tmp.str();
284 out.write(result.c_str(), (std::min)(ntrunc, static_cast<int>(result.size())));
285}
286#define TINYFORMAT_DEFINE_FORMAT_TRUNCATED_CSTR(type) \
287inline void formatTruncated(std::ostream& out, type* value, int ntrunc) \
288{ \

Callers 1

formatValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected