ArgsT

Much like std.array.Appender!string, but specifically geared towards building a command string out of arguments. String and Path can both be appended. All elements added will automatically be escaped, and separated by spaces, as necessary.

Members

Functions

opOpAssign
void opOpAssign(immutable(C)[] item)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
void opOpAssign(PathT!C item)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
void opOpAssign(Range items)
Undocumented in source. Be warned that the author may not have intended to support it.
put
void put(immutable(C)[] item)
Undocumented in source. Be warned that the author may not have intended to support it.
put
void put(PathT!C item)
Undocumented in source. Be warned that the author may not have intended to support it.
put
void put(Range items)
Undocumented in source. Be warned that the author may not have intended to support it.
reserve
void reserve(size_t newCapacity)
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

capacity
size_t capacity [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
data
immutable(C)[] data [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
length
size_t length [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

Args args;
args ~= Path(`some/big path/here/foobar`);
args ~= "-A";
args ~= "--bcd";
args ~= "Hello World";
args ~= Path("file.ext");

// On windows:
assert(args.data == `"some\big path\here\foobar" -A --bcd "Hello World" file.ext`);
// On linux:
assert(args.data == `'some/big path/here/foobar' -A --bcd 'Hello World' file.ext`);

wchar and dchar versions not yet supported, blocked by DMD issue #12112

Meta