MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / formatTruncated

Function formatTruncated

source/extern/tinyformat.h:280–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

formatValueFunction · 0.85

Calls 4

strMethod · 0.45
writeMethod · 0.45
c_strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected