aboutsummaryrefslogtreecommitdiff
path: root/std/io.zig
AgeCommit message (Collapse)Author
2017-12-10add self-hosted parsing and rendering to main testsAndrew Kelley
2017-12-04read a fileAndrew Kelley
2017-12-04rename builtin.is_big_endian to builtin.endianAndrew Kelley
See #307
2017-11-29better error code for File.getEndPos failureAndrew Kelley
2017-11-10fix test failure on 32 bit windowsAndrew Kelley
2017-11-10add windows implementation of io.File.getEndPosAndrew Kelley
2017-11-10add a std lib test for reading and writing filesAndrew Kelley
* fix fstat wrong on darwin * move std.debug.global_allocator to std.debug.global_allocator_state and make it private * add std.debug.global_allocator as a pointer (to upgrade your zig code remove the '&')
2017-11-07std.io: introduce buffered I/O and change APIAndrew Kelley
I started working on #465 and made some corresponding std.io API changes. New structs: * std.io.FileInStream * std.io.FileOutStream * std.io.BufferedOutStream * std.io.BufferedInStream Removed: * std.io.File.in_stream * std.io.File.out_stream Now instead of &file.out_stream or &file.in_stream to get access to the stream API for a file, you get it like this: var file_in_stream = io.FileInStream.init(&file); const in_stream = &file_in_stream.stream; var file_out_stream = io.FileOutStream.init(&file); const out_stream = &file_out_stream.stream; This is evidence that we might not need any OOP features - See #130.
2017-11-06fix typos in std.io (#589)scurest
Fixes a bug that prevented InStream.realAllAlloc from compiling.
2017-10-31breaking change to std.io APIAndrew Kelley
* Merge io.InStream and io.OutStream into io.File * Introduce io.OutStream and io.InStream interfaces - io.File implements both of these * Move mem.IncrementingAllocator to heap.IncrementingAllocator Instead of: ``` %return std.io.stderr.printf("hello\n"); ``` now do: ``` std.debug.warn("hello\n"); ``` To print to stdout, see `io.getStdOut()`. * Rename std.ArrayList.resizeDown to std.ArrayList.shrink.
2017-10-15std.io: fix bug when writing large bufferAndrew Kelley
2017-10-15fix std.io.InStream for windowsAndrew Kelley
now we handle PIPE_BROKEN as an EOF also set up framework for debugging unexpected posix/windows errors
2017-10-15fix child process stdio piping behavior on windowsAndrew Kelley
2017-10-15use correct integer type for windows BOOLAndrew Kelley
2017-10-14implement io.OutStream.openMode for windowsAndrew Kelley
2017-10-14std.io: remove unused constantsAndrew Kelley
2017-10-10fix std.io.OutStream.close for windowsAndrew Kelley
2017-10-09implement std.io.InStream for windowsAndrew Kelley
See #302
2017-10-09implement os.path.real for windows and update allocator interfaceAndrew Kelley
2017-10-03fix isatty for macOS and libc (#523)Snorre
2017-09-10std.io.InStream: add readLine function (#458)jean-dao
2017-08-27all behavior tests passing for macosAndrew Kelley
See #273
2017-08-27fixups to linux buildAndrew Kelley
2017-08-27progress toward tests passing on MacOSAndrew Kelley
2017-06-14partial implementation of printing floating point numbers with errol3Andrew Kelley
also add bitCast builtin function. closes #387
2017-06-04progress toward hello world without libc in windowsAndrew Kelley
2017-05-19change slicing syntax from ... to ..Andrew Kelley
See #359
2017-05-01`@import("builtin")` instead of `@compileVar`Andrew Kelley
See #226 Closes #220
2017-04-30zig build: support install for zig artifactsAndrew Kelley
also make os.copyFile atomic closes #332
2017-04-24better stack traces for ELF x86_64Andrew Kelley
2017-04-21zig build system supports building a libraryAndrew Kelley
See #329 Supporting work: * move std.cstr.Buffer0 to std.buffer.Buffer * add build.zig to example/shared_library/ and add an automated test for it * add std.list.List.resizeDown * improve std.os.makePath - no longer recursive - takes into account . and .. * add std.os.path.isAbsolute * add std.os.path.resolve * reimplement std.os.path.dirname - no longer requires an allocator - handles edge cases correctly
2017-04-20delete test_artifacts directory when tests completeAndrew Kelley
* add std.os.deleteTree * add std.os.deleteDir * add std.os.page_size * add std.os API for iterating over directories * refactor duplication in build.zig * update documentation on how to run tests
2017-04-03zig build system: add setLinkerScript and setTargetAndrew Kelley
* See #204 - zig build system * allow builtin types Os, Environ, Arch to be used at runtime. they have zero_bits=false and debug info now. * Eradicate use of `@alloca` in std for syscalls. See #225 * add `std.io.writeFile` * `std.debug.panic` adds a newline to format
2017-04-02zig build system progressAndrew Kelley
* In-progress os.ChildProcess.spawn implementation. See #204 * Add explicit cast from integer to error. Closes #294 * fix casting from error to integer * fix compiler crash when initializing variable to undefined with no type
2017-03-26organize std and make import relative to current fileAndrew Kelley
closes #216
2017-03-26replace "&&" and "||" with "and" and "or"Andrew Kelley
closes #272
2017-03-26new unreachable syntaxAndrew Kelley
* `noreturn` is the primitive type. * `unreachable` is a control flow keyword. * `@unreachable()` builtin function is deleted. closes #214
2017-03-09break off some of std.io into std.fmt, generalize printfAndrew Kelley
closes #250
2017-02-28rename CBuf to Buffer0 and some minor std API changesAndrew Kelley
2017-02-24add compile error for ignoring return valueAndrew Kelley
also introduce the _ identifier which you can assign to to discard a return value closes #219
2017-02-23add character format specifier to std.io.OutStream.printfAndrew Kelley
2017-02-12printf: only include + sign on signed ints if width specifiedAndrew Kelley
see #258
2017-02-12slice and array re-work plus some misc. changesAndrew Kelley
* `@truncate` builtin allows casting to the same size integer. It also performs two's complement casting between signed and unsigned integers. * The idiomatic way to convert between bytes and numbers is now `mem.readInt` and `mem.writeInt` instead of an unsafe cast. It works at compile time, is safer, and looks cleaner. * Implicitly casting an array to a slice is allowed only if the slice is const. * Constant pointer values know if their memory is from a compile- time constant value or a compile-time variable. * Cast from [N]u8 to []T no longer allowed, but [N]u8 to []const T still allowed. * Fix inability to pass a mutable pointer to comptime variable at compile-time to a function and have the function modify the memory pointed to by the pointer. * Add the `comptime T: type` parameter back to mem.eql. Prevents accidentally creating instantiations for arrays.
2017-02-11std.io.parseUnsigned buf parameter is constAndrew Kelley
fixes padding in printf See #258
2017-02-11fix crash on string literal with character code >= 128Andrew Kelley
See #258
2017-02-09lots of miscellaneous things all in one big commitAndrew Kelley
* add `@compileLog(...)` builtin function - Helps debug code running at compile time - See #240 * fix crash when there is an error on the start value of a slice * add implicit cast from int and float types to int and float literals if the value is known at compile time * make array concatenation work with slices in addition to arrays and c string literals * fix compile error message for something not having field access * fix crash when `@setDebugSafety()` was called from a function being evaluated at compile-time * fix compile-time evaluation of overflow math builtins. * avoid debug safety panic handler in builtin.o and compiler_rt.o since we use no debug safety in these modules anyway * add compiler_rt functions for division on ARM - Closes #254 * move default panic handler to std.debug so users can call it manually * std.io.printf supports a width in the format specifier
2017-02-07std.io supports printing integers as hex valuesAndrew Kelley
remove "unnecessary if statement" error this "depends on compile variable" code is too hard to validate, and has false negatives. not worth it right now. std.str removed, instead use std.mem. std.mem.eql and std.mem.sliceEql merged and do not require explicit type argument.
2017-02-02remove ability to mark if and switch as inlineAndrew Kelley
if and switch are implicitly inline if the condition/target expression is known at compile time. instead of: ``` inline if (condition) ... inline switch (target) ... ``` one can use: ``` if (comptime condition) ... switch (comptime target) ... ```
2017-01-31fix crash when passing void to var args functionAndrew Kelley
closes #235
2017-01-24printf var args proof of conceptAndrew Kelley
See #167 Need to troubleshoot when we send 2 slices to printf. It goes into an infinite loop. This commit introduces 4 builtin functions: * `@isInteger` * `@isFloat` * `@canImplictCast` * `@typeName`