fn ArgIteratorGeneral(comptime options: ArgIteratorGeneralOptions) type

A general Iterator to parse a string into a set of arguments

Parameters

Fields

allocator: Allocator,
index: usize = 0,
cmd_line: []const u8,
free_cmd_line_on_deinit: bool,

Should the cmd_line field be free’d (using the allocator) on deinit()?

buffer: []u8,

buffer MUST be long enough to hold the cmd_line plus a null terminator. buffer will we free’d (using the allocator) on deinit()

start: usize = 0,
end: usize = 0,

Functions

fn deinit(self: *Self) void

Call to free the internal buffer of the iterator.

fn init(allocator: Allocator, cmd_line_utf8: []const u8) InitError!Self

cmd_line_utf8 MUST remain valid and constant while using this instance

fn initTakeOwnership(allocator: Allocator, cmd_line_utf8: []const u8) InitError!Self

cmd_line_utf8 will be free’d (with the allocator) on deinit()

fn initUtf16le(allocator: Allocator, cmd_line_utf16le: [*:0]const u16) InitUtf16leError!Self

cmd_line_utf16le MUST be encoded UTF16-LE, and is converted to UTF-8 in an inter…

cmd_line_utf16le MUST be encoded UTF16-LE, and is converted to UTF-8 in an internal buffer

fn next(self: *Self) ?[:0]const u8

Returns a slice of the internal buffer that contains the next argument. Returns…

Returns a slice of the internal buffer that contains the next argument. Returns null when it reaches the end.

fn skip(self: *Self) bool

No documentation provided.

Values

Self
type