MCPcopy Create free account
hub / github.com/ElementsProject/elements / printFormatStringLiteral

Function printFormatStringLiteral

src/tinyformat.h:612–628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

610// The position of the first % character of the next nontrivial format spec is
611// returned, or the end of string.
612inline const char* printFormatStringLiteral(std::ostream& out, const char* fmt)
613{
614 const char* c = fmt;
615 for (;; ++c) {
616 if (*c == '\0') {
617 out.write(fmt, c - fmt);
618 return c;
619 }
620 else if (*c == '%') {
621 out.write(fmt, c - fmt);
622 if (*(c+1) != '%')
623 return c;
624 // for "%%", tack trailing % onto next literal section.
625 fmt = ++c;
626 }
627 }
628}
629
630
631// Parse a format string and set the stream state accordingly.

Callers 1

formatImplFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected