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

Function printFormatStringLiteral

source/extern/tinyformat.h:622–638  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

620// The position of the first % character of the next nontrivial format spec is
621// returned, or the end of string.
622inline const char* printFormatStringLiteral(std::ostream& out, const char* fmt)
623{
624 const char* c = fmt;
625 for (;; ++c) {
626 if (*c == '\0') {
627 out.write(fmt, c - fmt);
628 return c;
629 }
630 else if (*c == '%') {
631 out.write(fmt, c - fmt);
632 if (*(c+1) != '%')
633 return c;
634 // for "%%", tack trailing % onto next literal section.
635 fmt = ++c;
636 }
637 }
638}
639
640
641// 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