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

Function readFileToString

crengine/Tools/Fb2Linux/fb2v.cpp:31–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29
30
31lString8 readFileToString( const char * fname )
32{
33 lString8 buf;
34 LVStreamRef stream = LVOpenFileStream(fname, LVOM_READ);
35 if (!stream)
36 return buf;
37 int sz = stream->GetSize();
38 if (sz>0)
39 {
40 buf.insert( 0, sz, ' ' );
41 stream->Read( buf.modify(), sz, NULL );
42 }
43 return buf;
44}
45
46
47class MyXWindowApp

Callers 1

mainFunction · 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