diff --git a/octa/format.hh b/octa/format.hh index c9b42dc..4da0fc7 100644 --- a/octa/format.hh +++ b/octa/format.hh @@ -470,8 +470,8 @@ namespace detail { } /* namespace detail */ template -static inline octa::Ptrdiff formatted_write(R writer, octa::Size &fmtn, - const char *fmt, const A &...args) { +static inline octa::Ptrdiff format(R writer, octa::Size &fmtn, + const char *fmt, const A &...args) { octa::Size argidx = 1, retn = 0, twr = 0; octa::Ptrdiff written = 0; octa::detail::WriteSpec spec(fmt); @@ -523,8 +523,8 @@ static inline octa::Ptrdiff formatted_write(R writer, octa::Size &fmtn, } template -static inline octa::Ptrdiff formatted_write(R writer, octa::Size &fmtn, - const char *fmt) { +static inline octa::Ptrdiff format(R writer, octa::Size &fmtn, + const char *fmt) { octa::Size written = 0; octa::detail::WriteSpec spec(fmt); if (spec.read_until_spec(writer, &written)) return -1; @@ -533,23 +533,23 @@ static inline octa::Ptrdiff formatted_write(R writer, octa::Size &fmtn, } template -octa::Ptrdiff formatted_write(R writer, octa::Size &fmtn, - const octa::AnyString &fmt, - const A &...args) { - return formatted_write(writer, fmtn, fmt.data(), args...); +octa::Ptrdiff format(R writer, octa::Size &fmtn, + const octa::AnyString &fmt, + const A &...args) { + return format(writer, fmtn, fmt.data(), args...); } template -octa::Ptrdiff formatted_write(R writer, const char *fmt, const A &...args) { +octa::Ptrdiff format(R writer, const char *fmt, const A &...args) { octa::Size fmtn = 0; - return formatted_write(writer, fmtn, fmt, args...); + return format(writer, fmtn, fmt, args...); } template -octa::Ptrdiff formatted_write(R writer, const octa::AnyString &fmt, - const A &...args) { +octa::Ptrdiff format(R writer, const octa::AnyString &fmt, + const A &...args) { octa::Size fmtn = 0; - return formatted_write(writer, fmtn, fmt.data(), args...); + return format(writer, fmtn, fmt.data(), args...); } } /* namespace octa */ diff --git a/octa/io.hh b/octa/io.hh index 1ec061d..76b3ec7 100644 --- a/octa/io.hh +++ b/octa/io.hh @@ -199,7 +199,7 @@ namespace detail { template static inline void writef(const char *fmt, const A &...args) { char buf[512]; - octa::Ptrdiff need = octa::formatted_write(octa::detail::FormatOutRange< + octa::Ptrdiff need = octa::format(octa::detail::FormatOutRange< sizeof(buf)>(buf), fmt, args...); if (need < 0) return; else if (octa::Size(need) < sizeof(buf)) { @@ -208,8 +208,7 @@ static inline void writef(const char *fmt, const A &...args) { } octa::Vector s; s.reserve(need); - octa::formatted_write(octa::detail::UnsafeWritefRange(s.data()), fmt, - args...); + octa::format(octa::detail::UnsafeWritefRange(s.data()), fmt, args...); fwrite(s.data(), 1, need, ::stdout); } diff --git a/octa/stream.hh b/octa/stream.hh index d35897c..7069640 100644 --- a/octa/stream.hh +++ b/octa/stream.hh @@ -125,14 +125,14 @@ struct Stream { template bool writef(const char *fmt, const A &...args) { char buf[512]; - octa::Size need = octa::formatted_write(octa::detail::FormatOutRange< + octa::Size need = octa::format(octa::detail::FormatOutRange< sizeof(buf)>(buf), fmt, args...); if (need < sizeof(buf)) return write_bytes(buf, need) == need; octa::String s; s.reserve(need); s[need] = '\0'; - octa::formatted_write(s.iter(), fmt, args...); + octa::format(s.iter(), fmt, args...); return write_bytes(s.data(), need) == need; }