import (package) stdstd.(module) std.stdioCategory Symbols File handles _popen File isFileHandle openNetwork stderr stdin stdout Reading chunks lines readf readfln readln Writing toFile write writef writefln writeln Misc KeepTerminator LockType StdioException
Standard I/O functions that extend core.stdc.stdio. core.stdc.stdio
is publically imported when importing std.stdio.
There are three layers of I/O:
The lowest layer is the operating system layer. The two main schemes are Windows and Posix.
C's stdio.h which unifies the two operating system schemes.
std.stdio, this module, unifies the various stdio.h implementations into
a high level package for D programs.
Source
std/stdio.d
stdio;
enum (alias) object.string = stringstring (constant) string probe1.where!("\n a\n b\n ", "/home/runner/work/sparkles/sparkles/docs/research/ui-authoring/experiments/ui-api-demo-markup/probes/probe1.d", 27LU) = "enum __w = \"/home/runner/work/sparkles/sparkles/docs/research/ui-authoring/experiments/ui-api-demo-markup/probes/probe1.d\"; enum __l = 27LU;"where(string src, string file = __FILE__, size_t line = __LINE__) = "enum __w = \"" ~ (constant) string probe1.file = "/home/runner/work/sparkles/sparkles/docs/research/ui-authoring/experiments/ui-api-demo-markup/probes/probe1.d"file ~ "\"; enum __l = " ~ (constant) ulong probe1.line = 27LUline.(constant) string 27LU.stringof = "27LU"stringof ~ ";";
template (template) probe1.Loc(string f = __FILE__, ulong l = __LINE__)Loc(string f = __FILE__, size_t l = __LINE__) { enum (constant) probe1.Loc(string f = __FILE__, ulong l = __LINE__) = lLoc = l; }
void void probe1.apply(scope void delegate(int ui) pure nothrow @nogc @safe dg) pure nothrow @nogc @safeapply(scope void delegate(int (parameter) int uiui) @safe pure nothrow @nogc (parameter) void delegate(int ui) pure nothrow @nogc @safe dgdg) @safe pure nothrow @nogc { (parameter) void delegate(int ui) pure nothrow @nogc @safe dgdg(1); }
void void probe1.f(int ui) pure nothrow @nogc @safef(int (parameter) int uiui) @safe pure nothrow @nogc
{
int (local variable) int locallocal = 3;
scope (local variable) void delegate(int ui) pure nothrow @nogc @safe dgdg = delegate (int (parameter) int uiui) @safe pure nothrow @nogc { cast(void) ((parameter) int uiui + (local variable) int locallocal); };
(local variable) void delegate(int ui) pure nothrow @nogc @safe dgdg(2);
void probe1.apply(scope void delegate(int ui) pure nothrow @nogc @safe dg) pure nothrow @nogc @safeapply(delegate (int (parameter) int uiui) @safe pure nothrow @nogc { cast(void) ((parameter) int uiui + (local variable) int locallocal); });
int (local variable) int bodybody = 1;
}
void void probe1.g()g()
{
mixin("struct A1 {}");
pragma(msg, "plain mixin: ", __traits(getLocation, A1));
mixin("\n\nstruct A2 {}");
pragma(msg, "mixin line 3: ", __traits(getLocation, A2));
mixin("#line 100 \"app.d\"\n struct A3 {}");
pragma(msg, "with #line: ", __traits(getLocation, A3));
struct (struct) probe1.g.HereHere {}
pragma(msg, "after: ", __traits(getLocation, Here));
pragma(msg, "fn: ", __FUNCTION__);
mixin((template instance) probe1.where!("\n a\n b\n ", "/home/runner/work/sparkles/sparkles/docs/research/ui-authoring/experiments/ui-api-demo-markup/probes/probe1.d", 27LU)where!q{
a
b
});
pragma(msg, "where: ", __w, " ", __l);
pragma(msg, "parent: ", __traits(identifier, __traits(parent, Here)));
auto (local variable) void delegate() pure nothrow @nogc @safe xx = delegate () { struct (struct) probe1.g.__dgliteral_L33_C14.InIn {} pragma(msg, "in lambda parent: ", __traits(identifier, __traits(parent, In)), " fn=", __FUNCTION__); };
auto (local variable) void delegate(int a = __LINE__) pure nothrow @nogc @safe yy = delegate (int (parameter) int aa = mixin("__LINE__")) { };
}
void void D main()main() { void probe1.g()g(); }