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.

ControlClass

rc.ControlClass
pub const ControlClass = struct

File

Code

pub const ControlClass = struct {
    pub const map = std.StaticStringMapWithEql(
        res.ControlClass,
        std.static_string_map.eqlAsciiIgnoreCase,
    ).initComptime(.{
        .{ "BUTTON", .button },
        .{ "EDIT", .edit },
        .{ "STATIC", .static },
        .{ "LISTBOX", .listbox },
        .{ "SCROLLBAR", .scrollbar },
        .{ "COMBOBOX", .combobox },
    });

    /// Like `map.get` but works on WTF16 strings, for use with parsed
    /// string literals ("BUTTON", or even "\x42UTTON")
    pub fn fromWideString(str: []const u16) ?res.ControlClass {
        const utf16Literal = std.unicode.utf8ToUtf16LeStringLiteral;
        return if (ascii.eqlIgnoreCaseW(str, utf16Literal("BUTTON")))
            .button
        else if (ascii.eqlIgnoreCaseW(str, utf16Literal("EDIT")))
            .edit
        else if (ascii.eqlIgnoreCaseW(str, utf16Literal("STATIC")))
            .static
        else if (ascii.eqlIgnoreCaseW(str, utf16Literal("LISTBOX")))
            .listbox
        else if (ascii.eqlIgnoreCaseW(str, utf16Literal("SCROLLBAR")))
            .scrollbar
        else if (ascii.eqlIgnoreCaseW(str, utf16Literal("COMBOBOX")))
            .combobox
        else
            null;
    }
}