MCPcopy Create free account
hub / github.com/boostorg/json / read_file

Function read_file

example/file.hpp:140–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138};
139
140inline
141std::string
142read_file( char const* path, boost::system::error_code& ec )
143{
144 file f;
145 f.open( path, "r", ec );
146 if(ec)
147 return {};
148 std::string s;
149 s.resize( f.size() );
150 s.resize( f.read( &s[0], s.size(), ec) );
151 if(ec)
152 return {};
153 return s;
154}
155
156inline
157std::string

Callers 1

mainFunction · 0.85

Calls 5

system_errorClass · 0.85
openMethod · 0.80
resizeMethod · 0.80
sizeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected