#include <iostream>
int main() {
zstring filename = execdir() +
"/../data/in1.txt";
("Printing all lines in "_zs + filename).writeln(std::cout);
for (auto line : lines(filename)) {
}
}
A template class for character strings.
Definition string.hpp:62
void writeln(std::ostream &stream) const noexcept
Write string data to a stream in its format, appending a newline.
Definition string.hpp:1507
zpath execdir() noexcept
Get the directory path of the running executable.
Definition execdir.hpp:11
core::generator< zstring, fileHandle > lines(const zpath &filename)
Reads the contents of a file line-by-line.