From 6f2a0934a7c716c28f3faee625e84e1d02b3959b Mon Sep 17 00:00:00 2001 From: berni44 Date: Fri, 19 Mar 2021 12:12:34 +0100 Subject: [PATCH] Adapt imports of std.format to new structure of std.format. --- std/array.d | 11 ++++++----- std/bigint.d | 13 +++++++------ std/bitmanip.d | 2 +- std/complex.d | 6 +++--- std/concurrency.d | 2 +- std/conv.d | 9 ++++++--- std/datetime/date.d | 16 ++++++++-------- std/datetime/timezone.d | 4 ++-- std/experimental/logger/core.d | 16 ++++++++-------- std/experimental/logger/filelogger.d | 2 +- std/file.d | 2 +- std/getopt.d | 2 +- std/json.d | 4 ++-- std/numeric.d | 3 ++- std/outbuffer.d | 4 ++-- std/range/primitives.d | 4 ++-- std/regex/internal/generator.d | 2 +- std/regex/internal/ir.d | 4 ++-- std/regex/internal/parser.d | 2 +- std/stdio.d | 12 ++++++------ std/sumtype.d | 6 +++--- std/typecons.d | 13 ++++++++----- std/uni/package.d | 6 +++--- std/uri.d | 2 +- std/windows/syserror.d | 2 +- 25 files changed, 79 insertions(+), 70 deletions(-) diff --git a/std/array.d b/std/array.d index 3bca83974..bca137dbf 100644 --- a/std/array.d +++ b/std/array.d @@ -1806,7 +1806,7 @@ if (isSomeString!S) @safe unittest { import std.conv : to; - import std.format; + import std.format : format; import std.typecons; static auto makeEntry(S)(string l, string[] r) @@ -3613,7 +3613,7 @@ if (isDynamicArray!A) */ string toString()() const { - import std.format : singleSpec; + import std.format.spec : singleSpec; auto app = appender!string(); auto spec = singleSpec("%s"); @@ -3634,7 +3634,7 @@ if (isDynamicArray!A) return app.data; } - import std.format : FormatSpec; + import std.format.spec : FormatSpec; /// ditto template toString(Writer) @@ -3642,7 +3642,7 @@ if (isDynamicArray!A) { void toString(ref Writer w, scope const ref FormatSpec!char fmt) const { - import std.format : formatValue; + import std.format.write : formatValue; import std.range.primitives : put; put(w, Unqual!(typeof(this)).stringof); put(w, '('); @@ -3670,7 +3670,8 @@ if (isDynamicArray!A) @safe pure unittest { - import std.format : format, singleSpec; + import std.format : format; + import std.format.spec : singleSpec; auto app = appender!(int[])(); app.put(1); diff --git a/std/bigint.d b/std/bigint.d index 47ce84e74..644f9f755 100644 --- a/std/bigint.d +++ b/std/bigint.d @@ -27,7 +27,8 @@ module std.bigint; import std.conv : ConvException; -import std.format : FormatSpec, FormatException; +import std.format.spec : FormatSpec; +import std.format : FormatException; import std.internal.math.biguintcore; import std.internal.math.biguintnoasm : BigDigit; import std.range.primitives; @@ -1366,7 +1367,7 @@ public: // the function failed to instantiate. @system unittest { - import std.format : FormatSpec; + import std.format.spec : FormatSpec; import std.array : appender; BigInt num = 503; auto dst = appender!string(); @@ -1746,7 +1747,7 @@ unittest @safe unittest { import std.array; - import std.format; + import std.format.write : formattedWrite; immutable string[][] table = [ /* fmt, +10 -10 */ @@ -1797,7 +1798,7 @@ unittest @safe unittest { import std.array; - import std.format; + import std.format.write : formattedWrite; immutable string[][] table = [ /* fmt, +10 -10 */ @@ -1848,7 +1849,7 @@ unittest @safe unittest { import std.array; - import std.format; + import std.format.write : formattedWrite; immutable string[][] table = [ /* fmt, +10 -10 */ @@ -1900,7 +1901,7 @@ unittest @safe unittest { import std.array; - import std.format; + import std.format.write : formattedWrite; auto w1 = appender!string(); auto w2 = appender!string(); diff --git a/std/bitmanip.d b/std/bitmanip.d index d71bc195f..671ab41bf 100644 --- a/std/bitmanip.d +++ b/std/bitmanip.d @@ -966,7 +966,7 @@ struct BitArray private: import core.bitop : btc, bts, btr, bsf, bt; - import std.format : FormatSpec; + import std.format.spec : FormatSpec; size_t _len; size_t* _ptr; diff --git a/std/complex.d b/std/complex.d index 6e42c4b37..46cb300cf 100644 --- a/std/complex.d +++ b/std/complex.d @@ -108,7 +108,7 @@ if (is(R : double) && is(I : double)) struct Complex(T) if (isFloatingPoint!T) { - import std.format : FormatSpec; + import std.format.spec : FormatSpec; import std.range.primitives : isOutputRange; /** The real part of the number. */ @@ -158,7 +158,7 @@ if (isFloatingPoint!T) void toString(Writer, Char)(scope Writer w, scope const ref FormatSpec!Char formatSpec) const if (isOutputRange!(Writer, const(Char)[])) { - import std.format : formatValue; + import std.format.write : formatValue; import std.math : signbit; import std.range.primitives : put; formatValue(w, re, formatSpec); @@ -1124,7 +1124,7 @@ Complex!T sqrt(T)(Complex!T z) @safe pure nothrow @nogc @safe unittest { // Test wide string formatting - import std.format; + import std.format.write : formattedWrite; wstring wformat(T)(string format, Complex!T c) { import std.array : appender; diff --git a/std/concurrency.d b/std/concurrency.d index e2089bcd6..78f50d641 100644 --- a/std/concurrency.d +++ b/std/concurrency.d @@ -344,7 +344,7 @@ public: */ void toString(scope void delegate(const(char)[]) sink) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; formattedWrite(sink, "Tid(%x)", cast(void*) mbox); } diff --git a/std/conv.d b/std/conv.d index 3eead9a30..39c2eb0b5 100644 --- a/std/conv.d +++ b/std/conv.d @@ -145,7 +145,8 @@ private else { import std.array : appender; - import std.format : FormatSpec, formatValue; + import std.format.spec : FormatSpec; + import std.format.write : formatValue; auto w = appender!T(); FormatSpec!(ElementEncodingType!T) f; @@ -1038,7 +1039,8 @@ if (!(isImplicitlyConvertible!(S, T) && } import std.array : appender; - import std.format : FormatSpec, formatValue; + import std.format.spec : FormatSpec; + import std.format.write : formatValue; //Default case, delegate to format //Note: we don't call toStr directly, to avoid duplicate work. @@ -1100,7 +1102,8 @@ if (!(isImplicitlyConvertible!(S, T) && !isInfinite!S && isExactSomeString!T && !isCopyable!S && !isStaticArray!S) { import std.array : appender; - import std.format : FormatSpec, formatValue; + import std.format.spec : FormatSpec; + import std.format.write : formatValue; auto w = appender!T(); FormatSpec!(ElementEncodingType!T) f; diff --git a/std/datetime/date.d b/std/datetime/date.d index 0bc928521..fa78abe19 100644 --- a/std/datetime/date.d +++ b/std/datetime/date.d @@ -2890,7 +2890,7 @@ public: void toISOString(W)(ref W writer) const if (isOutputRange!(W, char)) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; _date.toISOString(writer); formattedWrite!("T%02d%02d%02d")( writer, @@ -2967,7 +2967,7 @@ public: void toISOExtString(W)(ref W writer) const if (isOutputRange!(W, char)) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; _date.toISOExtString(writer); formattedWrite!("T%02d:%02d:%02d")( writer, @@ -3043,7 +3043,7 @@ public: void toSimpleString(W)(ref W writer) const if (isOutputRange!(W, char)) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; _date.toSimpleString(writer); formattedWrite!(" %02d:%02d:%02d")( writer, @@ -7365,7 +7365,7 @@ public: void toISOString(W)(ref W writer) const if (isOutputRange!(W, char)) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; if (_year >= 0) { if (_year < 10_000) @@ -7449,7 +7449,7 @@ public: void toISOExtString(W)(ref W writer) const if (isOutputRange!(W, char)) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; if (_year >= 0) { if (_year < 10_000) @@ -7533,7 +7533,7 @@ public: void toSimpleString(W)(ref W writer) const if (isOutputRange!(W, char)) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; if (_year >= 0) { if (_year < 10_000) @@ -9064,7 +9064,7 @@ public: void toISOString(W)(ref W writer) const if (isOutputRange!(W, char)) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; formattedWrite(writer, "%02d%02d%02d", _hour, _minute, _second); } @@ -9111,7 +9111,7 @@ public: void toISOExtString(W)(ref W writer) const if (isOutputRange!(W, char)) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; formattedWrite(writer, "%02d:%02d:%02d", _hour, _minute, _second); } diff --git a/std/datetime/timezone.d b/std/datetime/timezone.d index dd5292d91..108360a33 100644 --- a/std/datetime/timezone.d +++ b/std/datetime/timezone.d @@ -1420,7 +1420,7 @@ package: { import std.datetime.date : DateTimeException; import std.exception : enforce; - import std.format : formattedWrite; + import std.format.write : formattedWrite; immutable absOffset = abs(utcOffset); enforce!DateTimeException(absOffset < dur!"minutes"(1440), "Offset from UTC must be within range (-24:00 - 24:00)."); @@ -1489,7 +1489,7 @@ package: static void toISOExtString(W)(ref W writer, Duration utcOffset) { import std.datetime.date : DateTimeException; - import std.format : formattedWrite; + import std.format.write : formattedWrite; import std.exception : enforce; immutable absOffset = abs(utcOffset); diff --git a/std/experimental/logger/core.d b/std/experimental/logger/core.d index 24e4f98e9..08d6cbede 100644 --- a/std/experimental/logger/core.d +++ b/std/experimental/logger/core.d @@ -168,7 +168,7 @@ The fractional second part is in milliseconds and is always 3 digits. void systimeToISOString(OutputRange)(OutputRange o, const ref SysTime time) if (isOutputRange!(OutputRange,string)) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; const auto dt = cast(DateTime) time; const auto fsec = time.fracSecs.total!"msecs"; @@ -657,7 +657,7 @@ private struct MsgRange private void formatString(A...)(MsgRange oRange, A args) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; foreach (arg; args) { @@ -1043,7 +1043,7 @@ abstract class Logger static if (isLoggingActiveAt!ll && ll >= moduleLogLevel!moduleName) synchronized (mutex) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; if (isLoggingEnabled(ll, this.logLevel_, globalLogLevel, condition)) @@ -1091,7 +1091,7 @@ abstract class Logger static if (isLoggingActiveAt!ll && ll >= moduleLogLevel!moduleName) synchronized (mutex) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; if (isLoggingEnabled(ll, this.logLevel_, globalLogLevel)) { @@ -1444,7 +1444,7 @@ abstract class Logger { static if (isLoggingActive) synchronized (mutex) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; if (isLoggingEnabled(ll, this.logLevel_, globalLogLevel, condition)) { @@ -1492,7 +1492,7 @@ abstract class Logger { static if (isLoggingActive) synchronized (mutex) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; if (isLoggingEnabled(ll, this.logLevel_, globalLogLevel)) { @@ -1541,7 +1541,7 @@ abstract class Logger { static if (isLoggingActive) synchronized (mutex) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; if (isLoggingEnabled(this.logLevel_, this.logLevel_, globalLogLevel, condition)) @@ -1587,7 +1587,7 @@ abstract class Logger { static if (isLoggingActive) synchronized (mutex) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; if (isLoggingEnabled(this.logLevel_, this.logLevel_, globalLogLevel)) diff --git a/std/experimental/logger/filelogger.d b/std/experimental/logger/filelogger.d index afe15d4ee..6fd7e5ff6 100644 --- a/std/experimental/logger/filelogger.d +++ b/std/experimental/logger/filelogger.d @@ -21,7 +21,7 @@ class FileLogger : Logger { import std.concurrency : Tid; import std.datetime.systime : SysTime; - import std.format : formattedWrite; + import std.format.write : formattedWrite; /** A constructor for the `FileLogger` Logger. diff --git a/std/file.d b/std/file.d index 078fa3a3d..ae1568681 100644 --- a/std/file.d +++ b/std/file.d @@ -5211,7 +5211,7 @@ slurp(Types...)(string filename, scope const(char)[] format) import std.array : appender; import std.conv : text; import std.exception : enforce; - import std.format : formattedRead; + import std.format.read : formattedRead; import std.stdio : File; import std.string : stripRight; diff --git a/std/getopt.d b/std/getopt.d index fbb6ed55d..b46390f39 100644 --- a/std/getopt.d +++ b/std/getopt.d @@ -1667,7 +1667,7 @@ Params: void defaultGetoptFormatter(Output)(Output output, string text, Option[] opt, string style = "%*s %*s%*s%s\n") { import std.algorithm.comparison : min, max; - import std.format : formattedWrite; + import std.format.write : formattedWrite; output.formattedWrite("%s\n", text); diff --git a/std/json.d b/std/json.d index c3e17ee66..73acf5a7c 100644 --- a/std/json.d +++ b/std/json.d @@ -1726,7 +1726,7 @@ if (isOutputRange!(Out,char)) // https://issues.dlang.org/show_bug.cgi?id=20511 @system unittest { - import std.format : formattedWrite; + import std.format.write : formattedWrite; import std.range : nullSink, outputRangeObject; outputRangeObject!(const(char)[])(nullSink) @@ -2325,7 +2325,7 @@ pure nothrow @safe unittest @safe unittest { import std.array : appender; - import std.format : formattedWrite; + import std.format.write : formattedWrite; string s = `{ diff --git a/std/numeric.d b/std/numeric.d index d88b8cdd9..0a8fc9084 100644 --- a/std/numeric.d +++ b/std/numeric.d @@ -605,7 +605,8 @@ public: /// ditto template toString() { - import std.format : FormatSpec, formatValue; + import std.format.spec : FormatSpec; + import std.format.write : formatValue; // Needs to be a template because of https://issues.dlang.org/show_bug.cgi?id=13737. void toString()(scope void delegate(const(char)[]) sink, scope const ref FormatSpec!char fmt) { diff --git a/std/outbuffer.d b/std/outbuffer.d index 41e298d6c..584f9c20f 100644 --- a/std/outbuffer.d +++ b/std/outbuffer.d @@ -311,7 +311,7 @@ class OutBuffer */ void writef(Char, A...)(scope const(Char)[] fmt, A args) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; formattedWrite(this, fmt, args); } @@ -337,7 +337,7 @@ class OutBuffer */ void writefln(Char, A...)(scope const(Char)[] fmt, A args) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; formattedWrite(this, fmt, args); put('\n'); } diff --git a/std/range/primitives.d b/std/range/primitives.d index 316c5c6ab..e32cd9dd9 100644 --- a/std/range/primitives.d +++ b/std/range/primitives.d @@ -814,7 +814,7 @@ pure @safe unittest // https://issues.dlang.org/show_bug.cgi?id=10571 @safe unittest { - import std.format; + import std.format.write : formattedWrite; string buf; formattedWrite((scope const(char)[] s) { buf ~= s; }, "%s", "hello"); assert(buf == "hello"); @@ -822,7 +822,7 @@ pure @safe unittest @safe unittest { - import std.format; + import std.format.write : formattedWrite; import std.meta : AliasSeq; struct PutC(C) { diff --git a/std/regex/internal/generator.d b/std/regex/internal/generator.d index 6831e59ed..c1fe4cde6 100644 --- a/std/regex/internal/generator.d +++ b/std/regex/internal/generator.d @@ -13,7 +13,7 @@ module std.regex.internal.generator; @trusted private struct SampleGenerator(Char) { import std.array : appender, Appender; - import std.format : formattedWrite; + import std.format.write : formattedWrite; import std.random : Xorshift; import std.regex.internal.ir : Regex, IR, IRL; import std.utf : isValidDchar, byChar; diff --git a/std/regex/internal/ir.d b/std/regex/internal/ir.d index 8193b1c3a..d037635ac 100644 --- a/std/regex/internal/ir.d +++ b/std/regex/internal/ir.d @@ -376,7 +376,7 @@ struct Group(DataIndex) if (begin < end) return "(unmatched)"; import std.array : appender; - import std.format : formattedWrite; + import std.format.write : formattedWrite; auto a = appender!string(); formattedWrite(a, "%s..%s", begin, end); return a.data; @@ -387,7 +387,7 @@ struct Group(DataIndex) @trusted string disassemble(in Bytecode[] irb, uint pc, in NamedGroup[] dict=[]) { import std.array : appender; - import std.format : formattedWrite; + import std.format.write : formattedWrite; auto output = appender!string(); formattedWrite(output,"%s", irb[pc].mnemonic); switch (irb[pc].code) diff --git a/std/regex/internal/parser.d b/std/regex/internal/parser.d index 74068d7a2..41ca6872a 100644 --- a/std/regex/internal/parser.d +++ b/std/regex/internal/parser.d @@ -1011,7 +1011,7 @@ if (isForwardRange!R && is(ElementType!R : dchar)) @trusted void error(string msg) { import std.array : appender; - import std.format : formattedWrite; + import std.format.write : formattedWrite; auto app = appender!string(); formattedWrite(app, "%s\nPattern with error: `%s` <--HERE-- `%s`", msg, origin[0..$-pat.length], pat); diff --git a/std/stdio.d b/std/stdio.d index 6a6a0a636..22e385536 100644 --- a/std/stdio.d +++ b/std/stdio.d @@ -312,7 +312,7 @@ public: { import std.conv : text; import std.exception : enforce; - import std.format : formattedRead; + import std.format.read : formattedRead; import std.string : chomp; enforce(file.isOpen, "ByRecord: File must be open"); @@ -1586,7 +1586,7 @@ Throws: `Exception` if the file is not opened. alias A = typeof(arg); static if (isAggregateType!A || is(A == enum)) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; formattedWrite(w, "%s", arg); } @@ -1610,7 +1610,7 @@ Throws: `Exception` if the file is not opened. } else { - import std.format : formattedWrite; + import std.format.write : formattedWrite; // Most general case formattedWrite(w, "%s", arg); @@ -1663,7 +1663,7 @@ Throws: `Exception` if the file is not opened. /// ditto void writef(Char, A...)(in Char[] fmt, A args) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; formattedWrite(lockingTextWriter(), fmt, args); } @@ -1682,7 +1682,7 @@ Throws: `Exception` if the file is not opened. /// ditto void writefln(Char, A...)(in Char[] fmt, A args) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; auto w = lockingTextWriter(); formattedWrite(w, fmt, args); @@ -2028,7 +2028,7 @@ $(CONSOLE /// ditto uint readf(Data...)(scope const(char)[] format, auto ref Data data) { - import std.format : formattedRead; + import std.format.read : formattedRead; assert(isOpen); auto input = LockingTextReader(this); diff --git a/std/sumtype.d b/std/sumtype.d index ced16841e..32afb9fe7 100644 --- a/std/sumtype.d +++ b/std/sumtype.d @@ -203,7 +203,7 @@ version (D_BetterC) {} else // Return a "pretty-printed" representation of expr string pprint(Expr expr) { - import std.format; + import std.format : format; return expr.match!( (double num) => "%g".format(num), @@ -223,7 +223,7 @@ version (D_BetterC) {} else assert(pprint(*myExpr) == "(a + (2 * b))"); } -import std.format : FormatSpec, singleSpec; +import std.format.spec : FormatSpec, singleSpec; import std.meta : AliasSeq, Filter, IndexOf = staticIndexOf, Map = staticMap; import std.meta : NoDuplicates; import std.meta : anySatisfy, allSatisfy; @@ -758,7 +758,7 @@ public: */ void toString(this This, Sink, Char)(ref Sink sink, const ref FormatSpec!Char fmt) { - import std.format : formatValue; + import std.format.write : formatValue; this.match!((ref value) { formatValue(sink, value, fmt); diff --git a/std/typecons.d b/std/typecons.d index 64e039fb5..514e70ee6 100644 --- a/std/typecons.d +++ b/std/typecons.d @@ -69,7 +69,8 @@ Authors: $(HTTP erdani.org, Andrei Alexandrescu), */ module std.typecons; -import std.format : singleSpec, FormatSpec, formatValue; +import std.format.spec : singleSpec, FormatSpec; +import std.format.write : formatValue; import std.meta : AliasSeq, allSatisfy; import std.range.primitives : isOutputRange; import std.traits; @@ -1268,7 +1269,7 @@ if (distinctFieldNames!(Specs)) return app.data; } - import std.format : FormatSpec; + import std.format.spec : FormatSpec; /** * Formats `Tuple` with either `%s`, `%(inner%)` or `%(inner%|sep%)`. @@ -2945,7 +2946,7 @@ struct Nullable(T) @safe unittest { import std.array : appender; - import std.format : formattedWrite; + import std.format.write : formattedWrite; auto app = appender!string(); Nullable!int a = 1; @@ -3617,7 +3618,8 @@ Params: template toString() { - import std.format : FormatSpec, formatValue; + import std.format.spec : FormatSpec; + import std.format.write : formatValue; // Needs to be a template because of https://issues.dlang.org/show_bug.cgi?id=13737. void toString()(scope void delegate(const(char)[]) sink, scope const ref FormatSpec!char fmt) { @@ -4126,7 +4128,8 @@ Params: template toString() { - import std.format : FormatSpec, formatValue; + import std.format.spec : FormatSpec; + import std.format.write : formatValue; // Needs to be a template because of https://issues.dlang.org/show_bug.cgi?id=13737. void toString()(scope void delegate(const(char)[]) sink, scope const ref FormatSpec!char fmt) { diff --git a/std/uni/package.d b/std/uni/package.d index 5816064df..84a92c969 100644 --- a/std/uni/package.d +++ b/std/uni/package.d @@ -960,7 +960,7 @@ struct MultiArray(Types...) void store(OutRange)(scope OutRange sink) const if (isOutputRange!(OutRange, char)) { - import std.format : formattedWrite; + import std.format.write : formattedWrite; formattedWrite(sink, "[%( 0x%x, %)]", offsets[]); formattedWrite(sink, ", [%( 0x%x, %)]", sz[]); formattedWrite(sink, ", [%( 0x%x, %)]", storage); @@ -2431,7 +2431,7 @@ public: --- */ - private import std.format : FormatSpec; + private import std.format.spec : FormatSpec; /*************************************** * Obtain a textual representation of this InversionList @@ -2444,7 +2444,7 @@ public: */ void toString(Writer)(scope Writer sink, scope const ref FormatSpec!char fmt) /* const */ { - import std.format : formatValue; + import std.format.write : formatValue; auto range = byInterval; if (range.empty) return; diff --git a/std/uri.d b/std/uri.d index 9a4947d8d..bf7cbc064 100644 --- a/std/uri.d +++ b/std/uri.d @@ -412,7 +412,7 @@ package string urlEncode(scope string[string] values) @safe pure return ""; import std.array : Appender; - import std.format : formattedWrite; + import std.format.write : formattedWrite; Appender!string enc; enc.reserve(values.length * 128); diff --git a/std/windows/syserror.d b/std/windows/syserror.d index 1347840f8..94f8ee59d 100644 --- a/std/windows/syserror.d +++ b/std/windows/syserror.d @@ -68,7 +68,7 @@ version (Windows): import core.sys.windows.winbase, core.sys.windows.winnt; import std.array : appender; import std.conv : to; -import std.format : formattedWrite; +import std.format.write : formattedWrite; import std.windows.charset; string sysErrorString(