aboutsummaryrefslogtreecommitdiff
path: root/std
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-12-11 09:21:06 -0500
committerAndrew Kelley <superjoe30@gmail.com>2017-12-11 09:21:06 -0500
commitfd6a36a23509fb956e05f0052b8ab5a80ead3380 (patch)
tree3d4467eae7a82b33d7684255e63b6df8cea3dd51 /std
parent9a51091a5c3d7547989d705e3feebad6252019a6 (diff)
downloadzig-fd6a36a23509fb956e05f0052b8ab5a80ead3380.tar.gz
zig-fd6a36a23509fb956e05f0052b8ab5a80ead3380.zip
self-hosted: parsing and rendering blocks
Diffstat (limited to 'std')
-rw-r--r--std/io.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/std/io.zig b/std/io.zig
index b677e457f7..0ba3d06a01 100644
--- a/std/io.zig
+++ b/std/io.zig
@@ -481,6 +481,14 @@ pub const OutStream = struct {
const slice = (&byte)[0..1];
return self.writeFn(self, slice);
}
+
+ pub fn writeByteNTimes(self: &OutStream, byte: u8, n: usize) -> %void {
+ const slice = (&byte)[0..1];
+ var i: usize = 0;
+ while (i < n) : (i += 1) {
+ %return self.writeFn(self, slice);
+ }
+ }
};
/// `path` may need to be copied in memory to add a null terminating byte. In this case