DoxigAlpha

nullTerminatedString

Given an index into string_bytes returns the null-terminated string found there.

Function parameters

Parameters

#

Type definitions in this namespace

Types

#
ErrorMessageList
There will be a MessageIndex for each len at start.
SourceLocation
Trailing:
ErrorMessage
Trailing:

Functions in this namespace

Functions

#
nullTerminatedString
Given an index into `string_bytes` returns the null-terminated string found there.

Special encoding when there are no errors.

Values

#
empty
Special encoding when there are no errors.

Source

Implementation

#
pub fn nullTerminatedString(eb: ErrorBundle, index: String) [:0]const u8 {
    const string_bytes = eb.string_bytes;
    var end: usize = index;
    while (string_bytes[end] != 0) {
        end += 1;
    }
    return string_bytes[index..end :0];
}