10 #include <boost/filesystem/path.hpp>
11 #include <boost/filesystem/fstream.hpp>
18 boost::filesystem::ofstream
ofs;
22 boost::filesystem::ifstream
ifs;
29 :my( new
impl() ) { this->
open( file, m ); }
33 const boost::filesystem::path& bfp = file;
34 my->ofs.open( bfp, std::ios_base::out | std::ios_base::binary | m );
37 my->ofs.write(buf,len);
42 return writesome(buffer.get() + offset, len);
60 this->
open( file, m );
65 const boost::filesystem::path& bfp = file;
66 my->ifs.open( bfp, std::ios::binary );
70 auto s = size_t(my->ifs.readsome( buf, len ));
77 s += size_t(my->ifs.readsome( &buf[1], len - 1));
84 return readsome(buffer.get() + offset, max);
90 my->ifs.read(buf,len);
91 if (my->ifs.gcount() < int64_t(len))
97 case beg: my->ifs.seekg( p, std::ios_base::beg );
return *
this;
98 case cur: my->ifs.seekg( p, std::ios_base::cur );
return *
this;
99 case end: my->ifs.seekg( p, std::ios_base::end );
return *
this;
109 const boost::filesystem::path& bfp = filename;
110 boost::filesystem::ifstream f( bfp, std::ios::in | std::ios::binary );
112 std::stringstream ss;