libzed 1.9.9
A general-purpose library for quick and simple data manipulation.
 
Loading...
Searching...
No Matches
lines.hpp
1#pragma once
2
3#include "../core/generator.hpp"
4#include "../core/string.hpp"
5#include <fstream>
6
7namespace z {
8namespace file {
9
13struct fileHandle {
17 std::istream *stream;
19 bool used;
22};
23
35
44core::generator<zstring, fileHandle> lines(std::istream &stream) noexcept;
45
46} // namespace file
47} // namespace z
A wrapper for std::vector.
Definition array.hpp:72
core::generator< zstring, fileHandle > lines(const zpath &filename)
Reads the contents of a file line-by-line.
State management struct for file streaming generator.
Definition lines.hpp:13
zpath filename
The filename.
Definition lines.hpp:15
bool used
Whether the file has been opened yet.
Definition lines.hpp:19
~fileHandle()
Destructor.
std::istream * stream
The current stream.
Definition lines.hpp:17