MCPcopy Create free account
hub / github.com/buggins/coolreader / readFileToString

Function readFileToString

crengine/Tools/Fb2Test/Fb2Test.cpp:141–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141lString8 readFileToString( const char * fname )
142{
143 lString8 buf;
144 LVStreamRef stream = LVOpenFileStream(fname, LVOM_READ);
145 if (!stream)
146 return buf;
147 int sz = stream->GetSize();
148 if (sz>0)
149 {
150 buf.insert( 0, sz, ' ' );
151 stream->Read( buf.modify(), sz, NULL );
152 }
153 return buf;
154}
155
156void TestWol()
157{

Callers 1

WinMainFunction · 0.70

Calls 5

LVOpenFileStreamFunction · 0.85
GetSizeMethod · 0.45
insertMethod · 0.45
ReadMethod · 0.45
modifyMethod · 0.45

Tested by

no test coverage detected