From c7ec29b2d6a66700933ede6ae2371e1d54744d67 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 30 May 2017 19:05:43 +0300 Subject: Add ifdstream::read_text() and ifdstream::read_binary() --- libbutl/fdstream.hxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libbutl/fdstream.hxx') diff --git a/libbutl/fdstream.hxx b/libbutl/fdstream.hxx index a8f203d..771d242 100644 --- a/libbutl/fdstream.hxx +++ b/libbutl/fdstream.hxx @@ -5,6 +5,7 @@ #ifndef LIBBUTL_FDSTREAM_HXX #define LIBBUTL_FDSTREAM_HXX +#include #include #include #include @@ -398,6 +399,17 @@ namespace butl auto_fd release (); // Note: no skipping. bool is_open () const {return buf_.is_open ();} + // Read the textual stream. The stream is supposed not to contain the null + // character. + // + std::string + read_text (); + + // Read the binary stream. + // + std::vector + read_binary (); + private: bool skip_ = false; }; -- cgit v1.1