mirror of
https://github.com/NixOS/nix
synced 2025-07-06 17:31:47 +02:00
nix::readLine: Add eofOk parameter
This commit is contained in:
parent
4a785a0400
commit
f7b1e535a3
2 changed files with 13 additions and 4 deletions
|
@ -77,8 +77,13 @@ void writeFull(Descriptor fd, std::string_view s, bool allowInterrupts = true);
|
|||
|
||||
/**
|
||||
* Read a line from a file descriptor.
|
||||
*
|
||||
* @param fd The file descriptor to read from
|
||||
* @param eofOk If true, return an unterminated line if EOF is reached. (e.g. the empty string)
|
||||
*
|
||||
* @return A line of text ending in `\n`, or a string without `\n` if `eofOk` is true and EOF is reached.
|
||||
*/
|
||||
std::string readLine(Descriptor fd);
|
||||
std::string readLine(Descriptor fd, bool eofOk = false);
|
||||
|
||||
/**
|
||||
* Write a line to a file descriptor.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue