Skip to documentation
SLOP

tiny.smg.text.list

Reference tiny.smg text list

Defined in text.

API (2)

Actions

Public operations.

No direct callersNo direct callstextlist
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Called byCallsNo direct callscli.validationvalidateQueryNameCommandcli.validationrejectUnexpectedOptionscli.validationrejectUnexpectedOptionsPlaincli.validationrejectUnexpectedScanOptionscli.validationoptionWithForbiddenValue+10 moretext.listcontainsString
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callscli.validationunexpectedArgumentMessageprivate; no linktools.smg.src.command.rules.addquantifiedRuletest; no linktools.smg.src.text.listtest: string slice helpers preserve m...text.listjoinStrings
Static calls · unresolved targets: 0 · external targets: 2.

Source: tools/smg/src/text/list.zig

zig
const std = @import("std");pub fn containsString(values: []const []const u8, needle: []const u8) bool {    for (values) |value| if (std.mem.eql(u8, value, needle)) return true;    return false;}pub fn joinStrings(allocator: std.mem.Allocator, values: []const []const u8, separator: []const u8) ![]const u8 {    var out: std.Io.Writer.Allocating = .init(allocator);    for (values, 0..) |value, index| {        if (index != 0) try out.writer.writeAll(separator);        try out.writer.writeAll(value);    }    return try out.toOwnedSlice();}test "string slice helpers preserve membership and joins" {    const values = [_][]const u8{ "text", "json", "dot" };    try std.testing.expect(containsString(&values, "json"));    try std.testing.expect(!containsString(&values, "mermaid"));    const joined = try joinStrings(std.testing.allocator, &values, ", ");    defer std.testing.allocator.free(joined);    try std.testing.expectEqualStrings("text, json, dot", joined);}

Source: tools/smg/src/text/root.zig:9

zig
pub const list = @import("list.zig");

Complete caller list for text.list.containsString

15 direct callers.

Audit

Definitions3
Public names3
Members0
Version26.7.0
Revisiondaab053ee433