aboutsummaryrefslogtreecommitdiff
path: root/std/io.zig
AgeCommit message (Collapse)Author
2018-10-01std lib (breaking): posixRead can return less than buffer sizeAndrew Kelley
closes #1414 std.io.InStream.read now can return less than buffer size introduce std.io.InStream.readFull for previous behavior add std.os.File.openWriteNoClobberC rename std.os.deleteFileWindows to std.os.deleteFileW remove std.os.deleteFilePosix add std.os.deleteFileC std.os.copyFile no longer takes an allocator std.os.copyFileMode no longer takes an allocator std.os.AtomicFile no longer takes an allocator add std.os.renameW add windows support for std.os.renameC add a test for std.os.AtomicFile
2018-09-30update std lib API for I/OAndrew Kelley
std.io.FileInStream -> std.os.File.InStream std.io.FileInStream.init(file) -> file.inStream() std.io.FileOutStream -> std.os.File.OutStream std.io.FileOutStream.init(file) -> file.outStream() remove a lot of error code possibilities from os functions std.event.net.socketRead -> std.event.net.read std.event.net.socketWrite -> std.event.net.write add std.event.net.readv add std.event.net.writev add std.event.net.readvPosix add std.event.net.writevPosix add std.event.net.OutStream add std.event.net.InStream add std.event.io.InStream add std.event.io.OutStream
2018-09-14Add test for Queue.dumpWink Saville
To make dump testable added dumpToSteam which takes a stream as input and added the stream as a paraemter to dumpRecursive. Added test "std.atomic.Queue dump" And to make the test more robust SliceOutStream.pos is now public. This allows the user of SliceOutStream to know the length of the data captured.
2018-09-13remove `this`. add `@This()`.Andrew Kelley
closes #1283
2018-09-02fix regressionsAndrew Kelley
2018-08-31finding source file, line, and column infoAndrew Kelley
2018-08-29printing info from the ModuleInfo substream of DebugInfoAndrew Kelley
2018-08-24macos stack traces have address-to-line translationAndrew Kelley
2018-08-21fix windowsAndrew Kelley
2018-07-30introduce std.event.fs for async file system functionsAndrew Kelley
only works on linux so far
2018-07-29add SliceOutStream, rename SliceStream to SliceInStream (#1301)dbandstra
2018-07-28add skipBytes function to InStreamdbandstra
this reads N bytes, discarding their values
2018-07-28add int writing functions to OutStreamdbandstra
added: writeInt, writeIntLe, and writeIntBe
2018-07-23std.io: PeekStream and SliceStreamNathan Sharp
SliceStream is a read-only stream wrapper around a slice of bytes. It allows adapting algorithms which work on InStreams to in-memory data. PeekStream is a stream wrapper which allows "putting back" bytes into the stream so that they can be read again. This will help make look-ahead parsers easier to write.
2018-06-21std: update stdlib to match updated allocator create signature; ref #733kristopher tate
2018-06-16add basic std lib code for loading dynamic librariesAndrew Kelley
this is going to only work for very basic libraries; I plan to slowly add more features over time to support more complicated libraries
2018-06-04Pointer Reform: proper slicing and indexing (#1053)Andrew Kelley
* enable slicing for single-item ptr to arrays * disable slicing for other single-item pointers * enable indexing for single-item ptr to arrays * disable indexing for other single-item pointers see #770 closes #386
2018-05-31use * for pointer type instead of &Andrew Kelley
See #770 To help automatically translate code, see the zig-fmt-pointer-reform-2 branch. This will convert all & into *. Due to the syntax ambiguity (which is why we are making this change), even address-of & will turn into *, so you'll have to manually fix thes instances. You will be guaranteed to get compile errors for them - expected 'type', found 'foo'
2018-05-30run zig fmt on the codebaseAndrew Kelley
2018-05-01behavior tests passing with new pointer deref syntaxAndrew Kelley
2018-04-09fix std.io.readline to work on windowsAndrew Kelley
closes #882
2018-04-02std.io.readLine functionAndrew Kelley
this provides a better input for guess number example. see #882
2018-03-31Fix undeclared identifier error in readUntilDelimiterBuffer and incorrect ↵Raul Leal
number of parameters in readUntilDelimiterAlloc (#877)
2018-02-10std.os and std.io API updateAndrew Kelley
* move std.io.File to std.os.File * add `zig fmt` to self hosted compiler * introduce std.io.BufferedAtomicFile API * introduce std.os.AtomicFile API * add `std.os.default_file_mode` * change FileMode on posix from being a usize to a u32 * add std.os.File.mode to return mode of an open file * std.os.copyFile copies the mode from the source file instead of using the default file mode for the dest file * move `std.os.line_sep` to `std.cstr.line_sep`
2018-02-10std zig tokenizer: don't require 3 newlines at the end of the sourceAndrew Kelley
2018-02-09std lib: modify allocator idiomAndrew Kelley
Before we accepted a nullable allocator for some stuff like opening files. Now we require an allocator. Use the mem.FixedBufferAllocator pattern if a bound on the amount to allocate is known. This also establishes the pattern that usually an allocator is the first argument to a function (possibly after "self"). fix docs for std.cstr.addNullByte self hosted compiler: * only build docs when explicitly asked to * clean up main * stub out zig fmt
2018-02-09fix compiler crash switching on global error with no elseAndrew Kelley
2018-02-08Merge remote-tracking branch 'origin/master' into error-setsAndrew Kelley
2018-02-08error sets - most tests passingAndrew Kelley
2018-02-05error sets - fix most std lib compile errorsAndrew Kelley
2018-02-05fix test failure, organize code, add new compile errorAndrew Kelley
2018-02-05make OutStream and InStream take an error set paramAndrew Kelley
2018-02-02*WIP* error sets - correctly resolve inferred error setsAndrew Kelley
2018-02-01*WIP* error sets - allow peer type resolution to create new error setAndrew Kelley
2018-02-01*WIP* error sets - fix implicit castAndrew Kelley
2018-01-31*WIP* error sets converting std libAndrew Kelley
2018-01-25syntax: functions require return type. remove `->`Andrew Kelley
The purpose of this is: * Only one way to do things * Changing a function with void return type to return a possible error becomes a 1 character change, subtly encouraging people to use errors. See #632 Here are some imperfect sed commands for performing this update: remove arrow: ``` sed -i 's/\(\bfn\b.*\)-> /\1/g' $(find . -name "*.zig") ``` add void: ``` sed -i 's/\(\bfn\b.*\))\s*{/\1) void {/g' $(find ../ -name "*.zig") ``` Some cleanup may be necessary, but this should do the bulk of the work.
2018-01-23replace %defer with errdeferAndrew Kelley
See #632 now we have 1 less sigil
2018-01-19usize might be same size as LARGE_INTEGER. If that's the case, then we don't ↵Jimmi Holst Christensen
want to compare pos to @maxValue(usize).
2018-01-19We now make a more correct conversion from windows LARGE_INTEGER type to usizeJimmi Holst Christensen
2018-01-19Removed bitcast from usize to isize in seekToJimmi Holst Christensen
2018-01-19Now using the right unexpectedError in seekForwardJimmi Holst Christensen
2018-01-19Implemented windows versions of seekTo and getPosJimmi Holst Christensen
2018-01-15clean up error return tracingAndrew Kelley
* error return tracing is disabled in release-fast mode * add @errorReturnTrace * zig build API changes build return type from `void` to `%void` * allow `void`, `noreturn`, and `u8` from main. closes #535
2018-01-07replace `%return` with `try`Andrew Kelley
See #632 better fits the convention of using keywords for control flow
2018-01-06Darwin -> MacOSX, added Zen. See #438Andrea Orru
2018-01-04self-hosted compiler works on windowsAndrew Kelley
* better error message for realpath failing * fix bug in std.io.readFileAllocExtra incorrectly returning error.EndOfStream * implement std.os.selfExePath and std.os.selfExeDirPath for windows
2017-12-26move utf8 parsing to stdJosh Wolfe
source files no longer need to end with a newline
2017-12-22explicitly return from blocksAndrew Kelley
instead of last statement being expression value closes #629
2017-12-11self-hosted: parsing and rendering blocksAndrew Kelley