17 #ifndef FOLLY_GEN_FILE_H_ 18 #error This file may only be included from folly/gen/File.h 21 #include <system_error> 42 }
while (n == -1 && errno == EINTR);
44 throw std::system_error(errno, std::system_category(),
"read failed");
73 template <
class Source,
class Value>
80 if (
v.size() > this->
buffer_->tailroom()) {
83 memcpy(this->
buffer_->writableTail(),
v.data(),
v.size());
101 }
while (n == -1 && errno == EINTR);
103 throw std::system_error(
104 errno, std::system_category(),
"write() failed");
124 | eachAs<StringPiece>()
125 |
resplit(delim, keepDelimiter);
152 inline auto byLine(
int fd,
char delim =
'\n') {
156 inline auto byLine(
const char*
f,
char delim =
'\n') {
std::vector< uint8_t > buffer(kBufferSize+16)
S resplit(char delimiter, bool keepDelimiter=false)
void write(const T &in, folly::io::Appender &appender)
bool apply(Body &&body) const
static constexpr bool infinite
FileReader(File file, std::unique_ptr< IOBuf > buffer)
constexpr detail::Map< Move > move
void advance(size_type n)
constexpr size_type size() const
void foreach(Body &&body) const
—— Concurrent Priority Queue Implementation ——
void write(ByteRange v) const
std::unique_ptr< IOBuf > buffer_
auto byLineFull(File file, char delim= '\n')
constexpr bool empty() const
FileWriter(File file, std::unique_ptr< IOBuf > buffer)
size_t read(T &out, folly::io::Cursor &cursor)
constexpr Iter data() const
auto byLine(File file, char delim= '\n')
auto byLineImpl(File file, char delim, bool keepDelimiter)
std::unique_ptr< IOBuf > buffer_
Range< const unsigned char * > ByteRange
S fromFile(File file, size_t bufferSize=4096)
void compose(const GenImpl< Value, Source > &source) const