Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

containsUnempty

On Windows, if key is not valid WTF-8, then error.InvalidWtf8 is returned.

See also:

Environ.containsUnempty
pub fn containsUnempty(environ: Environ, gpa: Allocator, key: []const u8) ContainsError!bool

File

lib/std/process/Environ.zig:578

Code

pub fn containsUnempty(environ: Environ, gpa: Allocator, key: []const u8) ContainsError!bool {
    if (native_os == .windows and !unicode.wtf8ValidateSlice(key)) return error.InvalidWtf8;
    var map = try createMap(environ, gpa);
    defer map.deinit();
    const value = map.get(key) orelse return false;
    return value.len != 0;
}