package core:bytes

Index

Types (2)
Constants (1)
Variables (0)

This section is empty.

Procedures (116)
Procedure Groups (0)

This section is empty.

Types

Buffer ¶

Buffer :: struct {
	buf:       [dynamic]u8,
	off:       int,
	last_read: Read_Op,
}
 

A Buffer is a variable-sized buffer of bytes with a io.Stream interface The zero value for Buffer is an empty buffer ready to use.

Reader ¶

Reader :: struct {
	s:         []u8,
	// read-only buffer
	i:         i64,
	// current reading index
	prev_rune: int,
}

Constants

MIN_READ ¶

MIN_READ :: 512

Variables

This section is empty.

Procedures

buffer_capacity ¶

buffer_capacity :: proc "odin" (b: ^Buffer) -> int {…}

buffer_destroy ¶

buffer_destroy :: proc "odin" (b: ^Buffer) {…}

buffer_grow ¶

buffer_grow :: proc "odin" (b: ^Buffer, n: int) {…}

buffer_init ¶

buffer_init :: proc "odin" (b: ^Buffer, buf: []u8) {…}

buffer_init_allocator ¶

buffer_init_allocator :: proc "odin" (b: ^Buffer, len, cap: int, allocator := context.allocator) {…}

buffer_init_string ¶

buffer_init_string :: proc "odin" (b: ^Buffer, s: string) {…}

buffer_is_empty ¶

buffer_is_empty :: proc "odin" (b: ^Buffer) -> bool {…}

buffer_length ¶

buffer_length :: proc "odin" (b: ^Buffer) -> int {…}

buffer_next ¶

buffer_next :: proc "odin" (b: ^Buffer, n: int) -> []u8 {…}

buffer_read ¶

buffer_read :: proc "odin" (b: ^Buffer, p: []u8) -> (n: int, err: io.Error) {…}

buffer_read_at ¶

buffer_read_at :: proc "odin" (b: ^Buffer, p: []u8, offset: int) -> (n: int, err: io.Error) {…}

buffer_read_byte ¶

buffer_read_byte :: proc "odin" (b: ^Buffer) -> (u8, io.Error) {…}

buffer_read_bytes ¶

buffer_read_bytes :: proc "odin" (b: ^Buffer, delim: u8) -> (line: []u8, err: io.Error) {…}

buffer_read_from ¶

buffer_read_from :: proc "odin" (b: ^Buffer, r: io.Reader) -> (n: i64, err: io.Error) {…}

buffer_read_ptr ¶

buffer_read_ptr :: proc "odin" (b: ^Buffer, ptr: rawptr, size: int) -> (n: int, err: io.Error) {…}

buffer_read_rune ¶

buffer_read_rune :: proc "odin" (b: ^Buffer) -> (r: rune, size: int, err: io.Error) {…}

buffer_read_string ¶

buffer_read_string :: proc "odin" (b: ^Buffer, delim: u8) -> (line: string, err: io.Error) {…}

buffer_reset ¶

buffer_reset :: proc "odin" (b: ^Buffer) {…}

buffer_to_bytes ¶

buffer_to_bytes :: proc "odin" (b: ^Buffer) -> []u8 {…}

buffer_to_stream ¶

buffer_to_stream :: proc "odin" (b: ^Buffer) -> (s: io.Stream) {…}

buffer_to_string ¶

buffer_to_string :: proc "odin" (b: ^Buffer) -> string {…}

buffer_truncate ¶

buffer_truncate :: proc "odin" (b: ^Buffer, n: int) {…}

buffer_unread_byte ¶

buffer_unread_byte :: proc "odin" (b: ^Buffer) -> io.Error {…}

buffer_unread_rune ¶

buffer_unread_rune :: proc "odin" (b: ^Buffer) -> io.Error {…}

buffer_write ¶

buffer_write :: proc "odin" (b: ^Buffer, p: []u8) -> (n: int, err: io.Error) {…}

buffer_write_at ¶

buffer_write_at :: proc "odin" (b: ^Buffer, p: []u8, offset: int) -> (n: int, err: io.Error) {…}

buffer_write_byte ¶

buffer_write_byte :: proc "odin" (b: ^Buffer, c: u8) -> io.Error {…}

buffer_write_ptr ¶

buffer_write_ptr :: proc "odin" (b: ^Buffer, ptr: rawptr, size: int) -> (n: int, err: io.Error) {…}

buffer_write_rune ¶

buffer_write_rune :: proc "odin" (b: ^Buffer, r: rune) -> (n: int, err: io.Error) {…}

buffer_write_string ¶

buffer_write_string :: proc "odin" (b: ^Buffer, s: string) -> (n: int, err: io.Error) {…}

buffer_write_to ¶

buffer_write_to :: proc "odin" (b: ^Buffer, w: io.Writer) -> (n: i64, err: io.Error) {…}

center_justify ¶

center_justify :: centre_justify
 

centre_justify returns a byte slice with a pad byte slice at boths sides if the str's rune length is smaller than length

centre_justify ¶

centre_justify :: proc "odin" (str: []u8, length: int, pad: []u8, allocator := context.allocator) -> []u8 {…}
 

centre_justify returns a byte slice with a pad byte slice at boths sides if the str's rune length is smaller than length

clone ¶

clone :: proc "odin" (s: []u8, allocator := context.allocator, loc := #caller_location) -> []u8 {…}

clone_safe ¶

clone_safe :: proc "odin" (s: []u8, allocator := context.allocator, loc := #caller_location) -> (data: []u8, err: runtime.Allocator_Error) {…}

compare ¶

compare :: proc "odin" (lhs, rhs: []u8) -> int {…}
 

Compares two strings, returning a value representing which one comes first lexiographically. -1 for a; 1 for b, or 0 if they are equal.

concatenate ¶

concatenate :: proc "odin" (a: [][]u8, allocator := context.allocator) -> []u8 {…}

concatenate_safe ¶

concatenate_safe :: proc "odin" (a: [][]u8, allocator := context.allocator) -> (data: []u8, err: runtime.Allocator_Error) {…}

contains ¶

contains :: proc "odin" (s, substr: []u8) -> bool {…}

contains_any ¶

contains_any :: proc "odin" (s, substr: []u8) -> bool {…}

contains_rune ¶

contains_rune :: proc "odin" (s: []u8, r: rune) -> int {…}

count ¶

count :: proc "odin" (lhs, rhs: []u8) -> int {…}

equal ¶

equal :: proc "odin" (s, substr: []u8) -> bool {…}

equal_fold ¶

equal_fold :: proc "odin" (s, substr: []u8) -> bool {…}

expand_tabs ¶

expand_tabs :: proc "odin" (s: []u8, count: int, allocator := context.allocator) -> []u8 {…}

fields ¶

fields :: proc "odin" (s: []u8, allocator := context.allocator) -> [][]u8 {…}
 

fields splits the byte slice s around each instance of one or more consecutive white space character, defined by unicode.is_space returning a slice of subslices of s or an empty slice if s only contains white space

fields_proc ¶

fields_proc :: proc "odin" (s: []u8, f: proc "odin" (r: rune) -> bool, allocator := context.allocator) -> [][]u8 {…}
 

fields_proc splits the byte slice s at each run of unicode code points ch satisfying f(ch) returns a slice of subslices of s If all code points in s satisfy f(ch) or string is empty, an empty slice is returned

fields_proc makes no guarantee about the order in which it calls f(ch) it assumes that f always returns the same value for a given ch

has_prefix ¶

has_prefix :: proc "odin" (s, substr: []u8) -> bool {…}

has_suffix ¶

has_suffix :: proc "odin" (s, substr: []u8) -> bool {…}

index ¶

index :: proc "odin" (lhs, rhs: []u8) -> int {…}

index_any ¶

index_any :: proc "odin" (lhs, rhs: []u8) -> int {…}

index_byte ¶

index_byte :: proc "odin" (s: []u8, c: u8) -> int {…}

index_proc ¶

index_proc :: proc "odin" (s: []u8, p: proc "odin" (r: rune) -> bool, truth: bool = true) -> int {…}

index_proc_with_state ¶

index_proc_with_state :: proc "odin" (s: []u8, p: proc "odin" (state: rawptr, r: rune) -> bool, state: rawptr, truth: bool = true) -> int {…}

index_rune ¶

index_rune :: proc "odin" (s: []u8, r: rune) -> int {…}

is_ascii_space ¶

is_ascii_space :: proc "odin" (r: rune) -> bool {…}

is_in_cutset ¶

is_in_cutset :: proc "odin" (state: rawptr, r: rune) -> bool {…}

is_null ¶

is_null :: proc "odin" (r: rune) -> bool {…}

is_space ¶

is_space :: proc "odin" (r: rune) -> bool {…}

join ¶

join :: proc "odin" (a: [][]u8, sep: []u8, allocator := context.allocator) -> []u8 {…}

join_safe ¶

join_safe :: proc "odin" (a: [][]u8, sep: []u8, allocator := context.allocator) -> (data: []u8, err: runtime.Allocator_Error) {…}

last_index ¶

last_index :: proc "odin" (lhs, rhs: []u8) -> int {…}

last_index_any ¶

last_index_any :: proc "odin" (lhs, rhs: []u8) -> int {…}

last_index_byte ¶

last_index_byte :: proc "odin" (s: []u8, c: u8) -> int {…}
 

Returns -1 if c is not present

last_index_proc ¶

last_index_proc :: proc "odin" (s: []u8, p: proc "odin" (r: rune) -> bool, truth: bool = true) -> int {…}

last_index_proc_with_state ¶

last_index_proc_with_state :: proc "odin" (s: []u8, p: proc "odin" (state: rawptr, r: rune) -> bool, state: rawptr, truth: bool = true) -> int {…}

left_justify ¶

left_justify :: proc "odin" (str: []u8, length: int, pad: []u8, allocator := context.allocator) -> []u8 {…}
 

left_justify returns a byte slice with a pad byte slice at left side if the str's rune length is smaller than length

partition ¶

partition :: proc "odin" (str, sep: []u8) -> (head, match, tail: []u8) {…}

ptr_from_bytes ¶

ptr_from_bytes :: proc "odin" (str: []u8) -> ^u8 {…}

reader_init ¶

reader_init :: proc "odin" (r: ^Reader, s: []u8) {…}

reader_length ¶

reader_length :: proc "odin" (r: ^Reader) -> int {…}

reader_read ¶

reader_read :: proc "odin" (r: ^Reader, p: []u8) -> (n: int, err: io.Error) {…}

reader_read_at ¶

reader_read_at :: proc "odin" (r: ^Reader, p: []u8, off: i64) -> (n: int, err: io.Error) {…}

reader_read_byte ¶

reader_read_byte :: proc "odin" (r: ^Reader) -> (u8, io.Error) {…}

reader_read_rune ¶

reader_read_rune :: proc "odin" (r: ^Reader) -> (ch: rune, size: int, err: io.Error) {…}

reader_seek ¶

reader_seek :: proc "odin" (r: ^Reader, offset: i64, whence: io.Seek_From) -> (i64, io.Error) {…}

reader_size ¶

reader_size :: proc "odin" (r: ^Reader) -> i64 {…}

reader_to_stream ¶

reader_to_stream :: proc "odin" (r: ^Reader) -> (s: io.Stream) {…}

reader_unread_byte ¶

reader_unread_byte :: proc "odin" (r: ^Reader) -> io.Error {…}

reader_unread_rune ¶

reader_unread_rune :: proc "odin" (r: ^Reader) -> io.Error {…}

reader_write_to ¶

reader_write_to :: proc "odin" (r: ^Reader, w: io.Writer) -> (n: i64, err: io.Error) {…}

remove ¶

remove :: proc "odin" (s, key: []u8, n: int, allocator := context.allocator) -> (output: []u8, was_allocation: bool) {…}

remove_all ¶

remove_all :: proc "odin" (s, key: []u8, allocator := context.allocator) -> (output: []u8, was_allocation: bool) {…}

repeat ¶

repeat :: proc "odin" (s: []u8, count: int, allocator := context.allocator) -> []u8 {…}

replace ¶

replace :: proc "odin" (s, old, new: []u8, n: int, allocator := context.allocator) -> (output: []u8, was_allocation: bool) {…}
 

if n < 0, no limit on the number of replacements

replace_all ¶

replace_all :: proc "odin" (s, old, new: []u8, allocator := context.allocator) -> (output: []u8, was_allocation: bool) {…}

reverse ¶

reverse :: proc "odin" (s: []u8, allocator := context.allocator) -> []u8 {…}

right_justify ¶

right_justify :: proc "odin" (str: []u8, length: int, pad: []u8, allocator := context.allocator) -> []u8 {…}
 

right_justify returns a byte slice with a pad byte slice at right side if the str's rune length is smaller than length

rune_count ¶

rune_count :: proc "odin" (s: []u8) -> int {…}

scrub ¶

scrub :: proc "odin" (s: []u8, replacement: []u8, allocator := context.allocator) -> []u8 {…}
 

scrub scruvs invalid utf-8 characters and replaces them with the replacement string Adjacent invalid bytes are only replaced once

split ¶

split :: proc "odin" (s, sep: []u8, allocator := context.allocator) -> [][]u8 {…}

split_after ¶

split_after :: proc "odin" (s, sep: []u8, allocator := context.allocator) -> [][]u8 {…}

split_after_iterator ¶

split_after_iterator :: proc "odin" (s: ^[]u8, sep: []u8) -> ([]u8, bool) {…}

split_after_n ¶

split_after_n :: proc "odin" (s, sep: []u8, n: int, allocator := context.allocator) -> [][]u8 {…}

split_iterator ¶

split_iterator :: proc "odin" (s: ^[]u8, sep: []u8) -> ([]u8, bool) {…}

split_multi ¶

split_multi :: proc "odin" (s: []u8, substrs: [][]u8, skip_empty: bool = false, allocator := context.allocator) -> [][]u8 {…}

split_multi_iterator ¶

split_multi_iterator :: proc "odin" (s: ^[]u8, substrs: [][]u8, skip_empty: bool = false) -> ([]u8, bool) {…}

split_n ¶

split_n :: proc "odin" (s, sep: []u8, n: int, allocator := context.allocator) -> [][]u8 {…}

trim ¶

trim :: proc "odin" (s: []u8, cutset: []u8) -> []u8 {…}

trim_left ¶

trim_left :: proc "odin" (s: []u8, cutset: []u8) -> []u8 {…}

trim_left_null ¶

trim_left_null :: proc "odin" (s: []u8) -> []u8 {…}

trim_left_proc ¶

trim_left_proc :: proc "odin" (s: []u8, p: proc "odin" (r: rune) -> bool) -> []u8 {…}

trim_left_proc_with_state ¶

trim_left_proc_with_state :: proc "odin" (s: []u8, p: proc "odin" (state: rawptr, r: rune) -> bool, state: rawptr) -> []u8 {…}

trim_left_space ¶

trim_left_space :: proc "odin" (s: []u8) -> []u8 {…}

trim_null ¶

trim_null :: proc "odin" (s: []u8) -> []u8 {…}

trim_prefix ¶

trim_prefix :: proc "odin" (s: []u8, cutset: []u8) -> []u8 {…}

trim_right ¶

trim_right :: proc "odin" (s: []u8, cutset: []u8) -> []u8 {…}

trim_right_null ¶

trim_right_null :: proc "odin" (s: []u8) -> []u8 {…}

trim_right_proc ¶

trim_right_proc :: proc "odin" (s: []u8, p: proc "odin" (r: rune) -> bool) -> []u8 {…}

trim_right_proc_with_state ¶

trim_right_proc_with_state :: proc "odin" (s: []u8, p: proc "odin" (state: rawptr, r: rune) -> bool, state: rawptr) -> []u8 {…}

trim_right_space ¶

trim_right_space :: proc "odin" (s: []u8) -> []u8 {…}

trim_space ¶

trim_space :: proc "odin" (s: []u8) -> []u8 {…}

trim_suffix ¶

trim_suffix :: proc "odin" (s: []u8, cutset: []u8) -> []u8 {…}

truncate_to_byte ¶

truncate_to_byte :: proc "odin" (str: []u8, b: u8) -> []u8 {…}

truncate_to_rune ¶

truncate_to_rune :: proc "odin" (str: []u8, r: rune) -> []u8 {…}

Procedure Groups

This section is empty.

Source Files

Generation Information

Generated with odin version dev-2022-10 (vendor "odin") Windows_amd64 @ 2022-10-05 21:11:47.304919700 +0000 UTC