21 Commits

Author SHA1 Message Date
Jacob Young
a21e7ab64f build_runner: port to new std.io.BufferedWriter API 2025-07-01 16:35:26 -07:00
Andrew Kelley
1164d5ece5 tweak std.io.Writer and followups
remove std.fs.Dir.readFileAllocOptions, replace with more flexible API
readFileIntoArrayList

remove std.fs.File.readToEndAllocOptions, replace with more flexible API
readIntoArrayList

update std.fs.File to new reader/writer API

add helper functions to std.io.Reader.Limit

replace std.io.Writer.FileLen with std.io.Reader.Limit

make offset a type rather than u64 so that it can distinguish between
streaming read and positional read

avoid an unnecessary allocation in std.zig.readSourceFileToEndAlloc when
there is a UTF-16 little endian BOM.
2025-07-01 16:35:26 -07:00
Andrew Kelley
383afd19d7 std.io.BufferedWriter: don't use ArrayList for this
it's the wrong abstraction and is only a footgun when used this way.
2025-07-01 16:35:26 -07:00
Andrew Kelley
faab6d5cbf fix hello world 2025-07-01 16:35:26 -07:00
Jacob Young
1501734747 io: fix compile errors 2025-07-01 16:35:26 -07:00
Andrew Kelley
9dc0b4a98f back to the anyerror!usize vtable 2025-07-01 16:35:26 -07:00
Andrew Kelley
6ac7931bec std: hacking around with buffered reader / writer semantics
I think I'm going to back out these vtable changes in the next commit
2025-07-01 16:35:26 -07:00
Andrew Kelley
890a02c345 std.io: move getStdIn, getStdOut, getStdErr functions to fs.File
preparing to rearrange std.io namespace into an interface
2025-07-01 16:35:26 -07:00
Andrew Kelley
57e1fc29d2 reader interface vecs and bufferedwriter arraylist 2025-07-01 16:35:26 -07:00
Andrew Kelley
5aa8573f2b redo reader 2025-07-01 16:35:26 -07:00
Andrew Kelley
051c7af49a get std lib json tests passing 2025-07-01 16:35:26 -07:00
Andrew Kelley
f3be721785 build runner compiling 2025-07-01 16:35:26 -07:00
Andrew Kelley
1d0495678d fixes
writeFile should be split into two
2025-07-01 16:35:25 -07:00
Andrew Kelley
35824e4822 writeSplat 2025-07-01 16:35:25 -07:00
Andrew Kelley
b26aceba7d thinking about splat being the only function 2025-07-01 16:35:25 -07:00
Andrew Kelley
00c6c836a6 std: start reworking std.io
hello world is compiling
2025-07-01 16:35:25 -07:00
mlugg
0fe3fd01dd
std: update std.builtin.Type fields to follow naming conventions
The compiler actually doesn't need any functional changes for this: Sema
does reification based on the tag indices of `std.builtin.Type` already!
So, no zig1.wasm update is necessary.

This change is necessary to disallow name clashes between fields and
decls on a type, which is a prerequisite of #9938.
2024-08-28 08:39:59 +01:00
Jonathan Marler
a96b78c170 add std.zip and support zip files in build.zig.zon
fixes #17408

Helpful reviewers/testers include Joshe Wolfe, Auguste Rame, Andrew
Kelley and Jacob Young.

Co-authored-by: Joel Gustafson <joelg@mit.edu>
2024-05-03 16:58:53 -04:00
Tristan Ross
099f3c4039
std.builtin: make container layout fields lowercase 2024-03-11 07:09:07 -07:00
Andrew Kelley
b7ba0b69b1 std.io.Writer: add writeFile method 2024-03-10 17:51:06 -07:00
Ian Johnson
e392c1a0b3 Add type-erased writer and GenericWriter
This is a companion to #17344 to apply the same change to the
`std.io.Writer` interface.
2024-01-29 19:02:18 -05:00