DoxigAlpha

ArgIteratorWindows

Iterator that implements the Windows command-line parsing algorithm. The implementation is intended to be compatible with the post-2008 C runtime, but is not intended to be compatible with CommandLineToArgvW since CommandLineToArgvW uses the pre-2008 parsing rules.

This iterator faithfully implements the parsing behavior observed from the C runtime with one exception: if the command-line string is empty, the iterator will immediately complete without returning any arguments (whereas the C runtime will return a single argument representing the name of the current executable).

The essential parts of the algorithm are described in Microsoft's documentation:

David Deley explains some additional undocumented quirks in great detail:

Fields of this type

Fields

#
cmd_line:[]const u16
Encoded as WTF-16 LE.
index:usize
= 0
buffer:[]u8
Owned by the iterator.
start:usize
= 0
end:usize
= 0

`cmd_line_w` *must* be a WTF16-LE-encoded string.

Functions

#
init
`cmd_line_w` *must* be a WTF16-LE-encoded string.
next
Returns the next argument and advances the iterator.
skip
Skips the next argument and advances the iterator.
deinit
Frees the iterator's copy of the command-line string and all previously returned

Error sets in this namespace

Error Sets

#