aboutsummaryrefslogtreecommitdiff
path: root/lib/std/io
AgeCommit message (Collapse)Author
2022-08-27Sema: add error for non-comptime param in comptime funcantlilja
Adds error for taking a non comptime parameter in a function returning a comptime-only type but not when that type is dependent on a parameter. Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-08-22std.io.Reader: bounded array functionsInKryption
* Add readIntoBoundedBytes * Add readBoundedBytes
2022-07-12std: update test cases to reflect new packed struct semanticsAndrew Kelley
2022-06-12Sema: add missing set_union_tagVeikka Tuominen
2022-06-07std: adjust for stage2 semanticsVeikka Tuominen
2022-06-03std: update tests to stage2 semanticsVeikka Tuominen
2022-05-27math: make `cast` return optional instead of an errorAli Chraghi
2022-04-27std: replace usage of std.meta.bitCount() with @bitSizeOf()Isaac Freund
2022-03-08deprecated TypeInfo in favor of TypeJonathan Marler
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-01-24readUntilDelimiter*: read only if buffer not fullPablo Santiago Blum de Aguiar
Ref.: #9594
2022-01-23Stop using LinearFifo in BufferedWriterJimmi Holst Christensen
Looking at the BufferedWriter assembly generated, one can see that is has to do a lot of work, just to copy over some bytes and increase an offset. This is because the LinearFifo is a much more general construct than what BufferedWriter needs and the optimizer cannot prove that we don't need to do this extra work.
2021-11-30allocgate: std Allocator interface refactorLee Cannon
2021-11-30std lib API deprecations for the upcoming 0.9.0 releaseAndrew Kelley
See #3811
2021-10-27std.rand: Refactor `Random` interfaceOminitay
These changes have been made to resolve issue #10037. The `Random` interface was implemented in such a way that causes significant slowdown when calling the `fill` function of the rng used. The `Random` interface is no longer stored in a field of the rng, and is instead returned by the child function `random()` of the rng. This avoids the performance issues caused by the interface.
2021-10-04migrate from `std.Target.current` to `@import("builtin").target`Andrew Kelley
closes #9388 closes #9321
2021-09-19Update all ensureCapacity calls to the relevant non-deprecated versionRyan Liptak
2021-09-01std: reorganization that allows new usingnamespace semanticsAndrew Kelley
The proposal #9629 is now accepted, usingnamespace stays but no longer puts identifiers in scope.
2021-08-24remove redundant license headers from zig standard libraryAndrew Kelley
We already have a LICENSE file that covers the Zig Standard Library. We no longer need to remind everyone that the license is MIT in every single file. Previously this was introduced to clarify the situation for a fork of Zig that made Zig's LICENSE file harder to find, and replaced it with their own license that required annual payments to their company. However that fork now appears to be dead. So there is no need to reinforce the copyright notice in every single file.
2021-08-24std: [breaking] move errno to become an nonexhaustive enumAndrew Kelley
The primary purpose of this change is to eliminate one usage of `usingnamespace` in the standard library - specifically the usage for errno values in `std.os.linux`. This is accomplished by truncating the `E` prefix from error values, and making errno a proper enum. A similar strategy can be used to eliminate some other `usingnamespace` sites in the std lib.
2021-08-20Add std.io.Reader.readUntilDelimiter()Samadi van Koten
2021-07-27WASI,libc: enable tests.Takeshi Yoneda
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2021-06-21fix code broken from previous commitJacob G-W
2021-06-08Limit Fixed Buffer Stream seekTo (#9023)Dustin Taylor
2021-06-04Makes std.io.StreamSource usable with freestandingFelix (xq) Queißner
2021-05-17std: update regarding std.builtin reorganizationAndrew Kelley
There are also some regressed std.fmt tests here and I haven't figured out what's wrong yet.
2021-05-08Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgenAndrew Kelley
Conflicts: * doc/langref.html.in * lib/std/enums.zig * lib/std/fmt.zig * lib/std/hash/auto_hash.zig * lib/std/math.zig * lib/std/mem.zig * lib/std/meta.zig * test/behavior/alignof.zig * test/behavior/bitcast.zig * test/behavior/bugs/1421.zig * test/behavior/cast.zig * test/behavior/ptrcast.zig * test/behavior/type_info.zig * test/behavior/vector.zig Master branch added `try` to a bunch of testing function calls, and some lines also had changed how to refer to the native architecture and other `@import("builtin")` stuff.
2021-05-08std: update usage of std.testingVeikka Tuominen
2021-04-28std: remove redundant comptime keywordAndrew Kelley
@g-w1's fancy new compile error in action
2021-04-04Fixed error types for GetSeekPosErrorEdward Dean
2021-03-12make std.c.getErrno() return same type as _errno() aka c_intSébastien Marie
adjust std.os.unexpectedErrno() to be correct for all std.os.system.errno (c_int, u12, usize, ...)
2021-03-03std: add io.Writer.writeStructdaurnimator
We have readStruct, add writeStruct for symmetry
2021-02-24Merge remote-tracking branch 'origin/master' into ast-memory-layoutAndrew Kelley
2021-02-21replace ArrayList.shrinkAndFree by ArrayList.shrinkRetainingCapacityBenjamin Graf
2021-02-16std: remove io.AutoIndentingStreamIsaac Freund
This type is not widely applicable enough to be a public part of the public interface of the std. The current implementation in only fully utilized by the zig fmt implementation, which could benefit by even tighter integration as will be demonstrated in the next commit. Therefore, move the current io.AutoIndentingStream to lib/std/zig/render.zig. The C backend of the self hosted compiler also use this type currently, but it does not require anywhere near its full complexity. Therefore, implement a greatly simplified version of this interface in src/codegen/c.zig.
2021-01-22std: Update `test ""` to `test` where it makes senseLemonBoy
2021-01-11std.EarlyEOFReader: rename to LimitedReaderAndrew Kelley
2021-01-11std: add LimitedReader: reader that returns EOF earlydaurnimator
2021-01-11std: reader.skipBytes's num_bytes should be a u64daurnimator
2021-01-08io: `FindByteOutStream` to `FindByteWriter`Jay Petacat
See #4917
2021-01-08Remove deprecated stream aliasesJay Petacat
2021-01-07Reduce use of deprecated IO typesJay Petacat
Related: #4917
2021-01-06std: Rename ArrayList shrink => shrinkAndFreeAlex Cameron
2021-01-02std: Use {s} instead of {} when printing stringsLemonBoy
2020-12-31Year++Frank Denis
2020-12-29std: fix Reader.readUntilDelimiterOrEofAlloc() APIIsaac Freund
The current API does not allow the user to distinguish between EOF and an empty line. Reader.readUntilDelimiterOrEof() gets this API right so update readUntilDelimiterOrEofAlloc() to match it. Returning an optional here additionally makes calling this in a loop much cleaner. Remove readUntilDelimiterOrEofArrayList() as it no longer needed to implement readUntilDelimiterOrEof() and has the same API issues described without a clear way to fix them.
2020-12-24std: clenup, fixes, fmtVeikka Tuominen
2020-12-23Added std.io.counting_readertgschultz
2020-12-20std: move serialization to the std lib orphanageAndrew Kelley
std-lib-orphanage commit 633792839f6f838fa864cde6af015413ee713404
2020-12-03Make zig fmt happy with multiline arguments for `readAllArrayListAligned`Lee Cannon
2020-12-02Add `readUntilDelimiterOrEofArrayList` & `readUntilDelimiterOrEofAlloc`Lee Cannon