aboutsummaryrefslogtreecommitdiff
path: root/core/bytes
Commit message (Collapse)AuthorAgeFilesLines
* Correct bytes._split_iteratorgingerBill2022-02-141-5/+5
|
* Correct _split_iteratorgingerBill2022-02-141-32/+8
|
* Remove the hidden NUL byte past the end from `bytes.clone`gingerBill2022-01-011-2/+1
|
* Fix `fields_proc` in `strings` and `bytes`gingerBill2021-12-111-1/+1
|
* Remove unneeded semicolons from the core librarygingerBill2021-08-313-685/+685
|
* Move `bytes` utils back to EXR code for the time being.Jeroen van Rijn2021-06-221-187/+0
| | | | Also, allow PNG example to be run directly from `core:image/png` directory.
* ZLIB: Start optimization.Jeroen van Rijn2021-06-211-4/+10
|
* Fix comment.Jeroen van Rijn2021-06-181-2/+2
|
* Add `bytes.buffer_create_of_type` and `bytes.buffer_convert_to_type`.Jeroen van Rijn2021-06-181-0/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convenience functions to reinterpret or cast one buffer to another type, or create a buffer of a specific type. Example: ```odin fmt.println("Convert []f16le (x2) to []f32 (x2)."); b := []u8{0, 60, 0, 60}; // == []f16{1.0, 1.0} res, backing, had_to_allocate, err := bytes.buffer_convert_to_type(2, f32, f16le, b); fmt.printf("res : %v\n", res); // [1.000, 1.000] fmt.printf("backing : %v\n", backing); // &Buffer{buf = [0, 0, 128, 63, 0, 0, 128, 63], off = 0, last_read = Invalid} fmt.printf("allocated: %v\n", had_to_allocate); // true fmt.printf("err : %v\n", err); // false if had_to_allocate { defer bytes.buffer_destroy(backing); } fmt.println("\nConvert []f16le (x2) to []u16 (x2)."); res2: []u16; res2, backing, had_to_allocate, err = bytes.buffer_convert_to_type(2, u16, f16le, b); fmt.printf("res : %v\n", res2); // [15360, 15360] fmt.printf("backing : %v\n", backing); // Buffer.buf points to `b` because it could be converted in-place. fmt.printf("allocated: %v\n", had_to_allocate); // false fmt.printf("err : %v\n", err); // false if had_to_allocate { defer bytes.buffer_destroy(backing); } fmt.println("\nConvert []f16le (x2) to []u16 (x2), force_convert=true."); res2, backing, had_to_allocate, err = bytes.buffer_convert_to_type(2, u16, f16le, b, true); fmt.printf("res : %v\n", res2); // [1, 1] fmt.printf("backing : %v\n", backing); // Buffer.buf points to `b` because it could be converted in-place. fmt.printf("allocated: %v\n", had_to_allocate); // false fmt.printf("err : %v\n", err); // false if had_to_allocate { defer bytes.buffer_destroy(backing); } ```
* Core library clean up: Make range expressions more consistent and replace ↵gingerBill2021-06-141-1/+1
| | | | uses of `..` with `..=`
* Add `bytes.remove`, `bytes.remove_all`, `strings.remove`, `strings.remove_all`gingerBill2021-05-231-0/+8
|
* Add truncate_to_byte and truncate_to_rune for packages strings and bytesgingerBill2021-04-221-0/+15
|
* Add buffer_read_at buffer_write_atgingerBill2021-04-141-0/+42
|
* `split*_iterator` procedures for package bytes and stringsgingerBill2021-03-181-0/+110
|
* Replace usage of `inline proc` with `#force_inline proc` in the core librarygingerBill2021-02-231-4/+4
|
* Add `bytes.buffer_write_to` and `bytes.buffer_read_from`gingerBill2020-12-171-8/+54
|
* Make bytes.odin consistent with strings.odin in functionalitygingerBill2020-12-172-54/+49
|
* Rename bytes/strings.odin to bytes/bytes.odingingerBill2020-12-171-0/+0
|
* Minor correction to bytes.Buffer's vtablegingerBill2020-12-051-0/+4
|
* Make bytes.Reader and strings.Reader have the same interfacegingerBill2020-12-041-3/+3
|
* Update bytes.ReadergingerBill2020-12-041-95/+129
|
* Add `bytes.Buffer`gingerBill2020-12-041-0/+331
|
* Begin work on `package bytes` (`[]byte` equivalent of `package strings`)gingerBill2020-12-042-0/+1175