cbase 1.46.11
C/C++ Static Template
Loading...
Searching...
No Matches
String Operations

Functions

static String8 str8 (u8 *str, usize size)
 Creates a String8 from a raw pointer and size.
static String8 str8_range (u8 *first, u8 *one_past_last)
 Creates a String8 spanning from the first pointer to the one_past_last pointer.
static String8 str8_cstr (const char *cstr)
 Converts a standard null-terminated C string into a String8.
static String8 str8_prefix (String8 str, usize size)
 Returns a substring containing the first size bytes of the input string.
static String8 str8_skip (String8 str, usize amt)
 Returns a substring by skipping the first amt bytes of the input string.
static String8 str8_substr (String8 str, usize first, usize one_past_last)
 Returns a substring spanning from first to one_past_last indices.
static b32 str8_match (String8 a, String8 b)
 Checks if two String8s are exactly equal (case-sensitive).

Detailed Description

Function Documentation

◆ str8()

String8 str8 ( u8 * str,
usize size )
inlinestatic

Creates a String8 from a raw pointer and size.

Definition at line 82 of file base_strings.h.

Here is the caller graph for this function:

◆ str8_cstr()

String8 str8_cstr ( const char * cstr)
inlinestatic

Converts a standard null-terminated C string into a String8.

Note
Calculates the size using O(N) traversal.

Definition at line 103 of file base_strings.h.

◆ str8_match()

b32 str8_match ( String8 a,
String8 b )
inlinestatic

Checks if two String8s are exactly equal (case-sensitive).

Definition at line 151 of file base_strings.h.

◆ str8_prefix()

String8 str8_prefix ( String8 str,
usize size )
inlinestatic

Returns a substring containing the first size bytes of the input string.

Definition at line 119 of file base_strings.h.

Here is the call graph for this function:

◆ str8_range()

String8 str8_range ( u8 * first,
u8 * one_past_last )
inlinestatic

Creates a String8 spanning from the first pointer to the one_past_last pointer.

Definition at line 92 of file base_strings.h.

◆ str8_skip()

String8 str8_skip ( String8 str,
usize amt )
inlinestatic

Returns a substring by skipping the first amt bytes of the input string.

Definition at line 129 of file base_strings.h.

Here is the call graph for this function:

◆ str8_substr()

String8 str8_substr ( String8 str,
usize first,
usize one_past_last )
inlinestatic

Returns a substring spanning from first to one_past_last indices.

Definition at line 139 of file base_strings.h.

Here is the call graph for this function: