String library module

Contents

Offers methods for c-string manipulation, but also a string library based on gb_string, which is c-string friendly.

Classes

struct zpl_string_header

Typedefs

using zpl_string = char*
using zpl_string_header = struct zpl_string_header

Functions

auto zpl_char_to_lower(char c) -> char
auto zpl_char_to_upper(char c) -> char
auto zpl_char_is_space(char c) -> zpl_b32
auto zpl_char_is_digit(char c) -> zpl_b32
auto zpl_char_is_hex_digit(char c) -> zpl_b32
auto zpl_char_is_alpha(char c) -> zpl_b32
auto zpl_char_is_alphanumeric(char c) -> zpl_b32
auto zpl_digit_to_int(char c) -> zpl_i32
auto zpl_hex_digit_to_int(char c) -> zpl_i32
auto zpl_char_to_hex_digit(char c) -> zpl_u8
auto zpl_str_to_lower(char* str) -> void
auto zpl_str_to_upper(char* str) -> void
auto zpl_str_trim(char* str, zpl_b32 skip_newline) -> char*
auto zpl_str_skip(char* str, char c) -> char*
auto zpl_strlen(const char* str) -> zpl_isize
auto zpl_strnlen(const char* str, zpl_isize max_len) -> zpl_isize
auto zpl_strcmp(const char* s1, const char* s2) -> zpl_i32
auto zpl_strncmp(const char* s1, const char* s2, zpl_isize len) -> zpl_i32
auto zpl_strcpy(char* dest, const char* source) -> char*
auto zpl_strdup(zpl_allocator a, char* src, zpl_isize max_len) -> char*
auto zpl_strncpy(char* dest, const char* source, zpl_isize len) -> char*
auto zpl_strlcpy(char* dest, const char* source, zpl_isize len) -> zpl_isize
auto zpl_strrev(char* str) -> char*
auto zpl_strtok(char* output, const char* src, const char* delimit) -> const char*
auto zpl_str_split_lines(zpl_allocator alloc, char* source, zpl_b32 strip_whitespace) -> char**
auto zpl_str_has_prefix(const char* str, const char* prefix) -> zpl_b32
auto zpl_str_has_suffix(const char* str, const char* suffix) -> zpl_b32
auto zpl_char_first_occurence(const char* str, char c) -> const char*
auto zpl_char_last_occurence(const char* str, char c) -> const char*
auto zpl_str_concat(char* dest, zpl_isize dest_len, const char* src_a, zpl_isize src_a_len, const char* src_b, zpl_isize src_b_len) -> void
auto zpl_str_to_zpl_u64(const char* str, char** end_ptr, zpl_i32 base) -> zpl_u64
auto zpl_str_to_zpl_i64(const char* str, char** end_ptr, zpl_i32 base) -> zpl_i64
auto zpl_str_to_zpl_f32(const char* str, char** end_ptr) -> zpl_f32
auto zpl_str_to_zpl_f64(const char* str, char** end_ptr) -> zpl_f64
auto zpl_zpl_i64_to_str(zpl_i64 value, char* string, zpl_i32 base) -> void
auto zpl_zpl_u64_to_str(zpl_u64 value, char* string, zpl_i32 base) -> void
auto zpl_utf8_strlen(zpl_u8 const* str) -> zpl_isize
auto zpl_utf8_strnlen(zpl_u8 const* str, zpl_isize max_len) -> zpl_isize
auto zpl_utf8_to_ucs2(zpl_u16* buffer, zpl_isize len, zpl_u8 const* str) -> zpl_u16*
auto zpl_ucs2_to_utf8(zpl_u8* buffer, zpl_isize len, zpl_u16 const* str) -> zpl_u8*
auto zpl_utf8_to_ucs2_buf(zpl_u8 const* str) -> zpl_u16*
auto zpl_ucs2_to_utf8_buf(zpl_u16 const* str) -> zpl_u8*
auto zpl_utf8_decode(zpl_u8 const* str, zpl_isize str_len, zpl_rune* codepoint) -> zpl_isize
auto zpl_utf8_codepoint_size(zpl_u8 const* str, zpl_isize str_len) -> zpl_isize
auto zpl_utf8_encode_rune(zpl_u8 buf[4], zpl_rune r) -> zpl_isize
auto zpl_string_make_reserve(zpl_allocator a, zpl_isize capacity) -> zpl_string
auto zpl_string_make(zpl_allocator a, const char* str) -> zpl_string
auto zpl_string_make_length(zpl_allocator a, void const* str, zpl_isize num_bytes) -> zpl_string
auto zpl_string_sprintf(zpl_allocator a, char* buf, zpl_isize num_bytes, const char* fmt, ...) -> zpl_string
auto zpl_string_sprintf_buf(zpl_allocator a, const char* fmt, ...) -> zpl_string
auto zpl_string_free(zpl_string str) -> void
auto zpl_string_duplicate(zpl_allocator a, zpl_string const str) -> zpl_string
auto zpl_string_length(zpl_string const str) -> zpl_isize
auto zpl_string_capacity(zpl_string const str) -> zpl_isize
auto zpl_string_available_space(zpl_string const str) -> zpl_isize
auto zpl_string_clear(zpl_string str) -> void
auto zpl_string_append(zpl_string str, zpl_string const other) -> zpl_string
auto zpl_string_append_length(zpl_string str, void const* other, zpl_isize num_bytes) -> zpl_string
auto zpl_string_appendc(zpl_string str, const char* other) -> zpl_string
auto zpl_string_set(zpl_string str, const char* cstr) -> zpl_string
auto zpl_string_make_space_for(zpl_string str, zpl_isize add_len) -> zpl_string
auto zpl_string_allocation_size(zpl_string const str) -> zpl_isize
auto zpl_string_are_equal(zpl_string const lhs, zpl_string const rhs) -> zpl_b32
auto zpl_string_trim(zpl_string str, const char* cut_set) -> zpl_string
auto zpl_string_trim_space(zpl_string str) -> zpl_string
auto zpl_string_append_rune(zpl_string str, zpl_rune r) -> zpl_string
auto zpl_string_append_fmt(zpl_string str, const char* fmt, ...) -> zpl_string

Defines

#define zpl_str_expand(str)
#define zpl_strchr
#define ZPL_STRING_HEADER(str)