MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / formatTruncated

Function formatTruncated

inst/include/Rcpp/utils/tinyformat/tinyformat.h:271–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269// Format at most ntrunc characters to the given stream.
270template<typename T>
271inline void formatTruncated(std::ostream& out, const T& value, int ntrunc)
272{
273 std::ostringstream tmp;
274 tmp << value;
275 std::string result = tmp.str();
276 out.write(result.c_str(), (std::min)(ntrunc, static_cast<int>(result.size())));
277}
278#define TINYFORMAT_DEFINE_FORMAT_TRUNCATED_CSTR(type) \
279inline void formatTruncated(std::ostream& out, type* value, int ntrunc) \
280{ \

Callers 1

formatValueFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected