Add FileDescriptor::write.

This commit is contained in:
Victor Zverovich
2014-05-03 12:06:28 -07:00
parent f3e123b304
commit 98b6e59272
2 changed files with 13 additions and 1 deletions
+5 -1
View File
@@ -194,10 +194,14 @@ class FileDescriptor {
// Returns the file descriptor.
int get() const FMT_NOEXCEPT(true) { return fd_; }
// Attempts to read count chars from the file associated with this file
// Attempts to read count bytes from the file associated with this file
// descriptor into the specified buffer.
std::streamsize read(void *buffer, std::size_t count);
// Attempts to write count bytes from the specified buffer to the file
// associated with this file descriptor.
std::streamsize write(const void *buffer, std::size_t count);
// Duplicates a file descriptor with the dup function and returns
// the duplicate. Throws fmt::SystemError on error.
static FileDescriptor dup(int fd);