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
7
namespace
z {
8
namespace
file {
9
13
struct
fileHandle
{
15
zpath
filename
;
17
std::istream *
stream
;
19
bool
used
;
21
~fileHandle
();
22
};
23
34
core::generator<zstring, fileHandle>
lines
(
const
zpath
&filename);
35
44
core::generator<zstring, fileHandle>
lines
(std::istream &stream)
noexcept
;
45
46
}
// namespace file
47
}
// namespace z
z::core::array
A wrapper for std::vector.
Definition
array.hpp:72
z::core::string< z::utf8 >
z::file::lines
core::generator< zstring, fileHandle > lines(const zpath &filename)
Reads the contents of a file line-by-line.
z::file::fileHandle
State management struct for file streaming generator.
Definition
lines.hpp:13
z::file::fileHandle::filename
zpath filename
The filename.
Definition
lines.hpp:15
z::file::fileHandle::used
bool used
Whether the file has been opened yet.
Definition
lines.hpp:19
z::file::fileHandle::~fileHandle
~fileHandle()
Destructor.
z::file::fileHandle::stream
std::istream * stream
The current stream.
Definition
lines.hpp:17
z
file
lines.hpp
Generated by
1.9.8