tiny.smg.text.list
Defined in text.
API (2)
Actions
Public operations.
Source
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.
tiny.smg.cli.validation.validateQueryNameCommand[function] attools/smg/src/cli/validation/query.zig:11tiny.smg.cli.validation.rejectUnexpectedOptions[function] attools/smg/src/cli/validation/unexpected.zig:9tiny.smg.cli.validation.rejectUnexpectedOptionsPlain[function] attools/smg/src/cli/validation/unexpected.zig:20tiny.smg.cli.validation.rejectUnexpectedScanOptions[function] attools/smg/src/cli/validation/unexpected.zig:31tiny.smg.cli.validation.optionWithForbiddenValue[function] attools/smg/src/cli/validation/value.zig:34tiny.smg.cli.validation.rejectInvalidChoiceOption[function] attools/smg/src/cli/validation/value.zig:43tiny.smg.cli.validation.rejectMissingOptionValues[function] attools/smg/src/cli/validation/value.zig:11tools.smg.src.command.analyze.support.appendUniqueDeltaName[function] — private; no exact target attools/smg/src/command/analyze/support.zig:53in nearest public ownertiny.smg.command.analyze.supporttools.smg.src.command.analyze.support.candidates[function] — private; no exact target attools/smg/src/command/analyze/support.zig:34in nearest public ownertiny.smg.command.analyze.supporttools.smg.src.command.exports.isDsmLevel[function] — private; no exact target attools/smg/src/command/exports.zig:67in nearest public ownertiny.smg.command.exportstools.smg.src.command.exports.isFormat[function] — private; no exact target attools/smg/src/command/exports.zig:63in nearest public ownertiny.smg.command.exportstiny.smg.command.query.run[function] attools/smg/src/command/query.zig:19tools.smg.src.command.scan.changed.append[function] — private; no exact target attools/smg/src/command/scan/changed.zig:54in nearest public ownertiny.smg.command.scan.changedtools.smg.src.command.scan.changed.test_changed_files_include_both_sides_of_a_source_rename[function] — test; no exact target attools/smg/src/command/scan/changed.zig:136in nearest public ownertiny.smg.command.scan.changedtools.smg.src.text.list.test_string_slice_helpers_preserve_membership_and_joins[function] — test; no exact target attools/smg/src/text/list.zig:17in nearest public ownertiny.smg.text.list
Audit
| Definitions | 3 |
|---|---|
| Public names | 3 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |