xieite ::read ()
Defined in fragment xieite :read
(header-only:
<xieite/io/read.hpp>
)
Reads the entire contents of an input stream to a
std ::string
.Declaration
#0Usesstd ::string read (std ::istream & stream )noexcept ;
std ::istreambuf_iterator
.#1
Reads the file stream in chunks, with the chunk size doubling every iteration.std ::string read (std ::FILE * const stream )noexcept ;
Example
Output:import std ;import xieite ;int main () {std ::ofstream ("msg.txt" ) <<"Hello, world!" ;xieite ::dump ( xieite ::read ( xieite ::tmp (std ::ifstream ("msg.txt" )))); }
Hello, world!