MCPcopy Create free account
hub / github.com/Kitware/VTK / ReadFile

Function ReadFile

IO/AMR/vtkAMReXGridReaderInternal.cxx:22–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20namespace
21{
22std::string ReadFile(const std::string& filename)
23{
24 std::string contents;
25 vtksys::ifstream stream(filename.c_str(), std::ios::binary);
26 if (stream)
27 {
28 stream.seekg(0, std::ios::end);
29 const std::size_t flength = stream.tellg();
30 stream.seekg(0, std::ios::beg);
31 std::vector<char> data(flength + 1 + (flength + 1) % 8); // padded for better alignment.
32 stream.read(data.data(), flength);
33 data[flength] = '\0';
34 contents = data.data();
35 }
36 return contents;
37}
38}
39
40RealDescriptor::RealDescriptor() = default;

Callers 9

ReadHeaderMethod · 0.70
ReadLevelHeaderMethod · 0.70
ReadExtraFabHeaderMethod · 0.70
readMethod · 0.50
_tiffReadProcFunction · 0.50
testPipeFunction · 0.50
testFileFunction · 0.50
ReadThreadProcFunction · 0.50

Calls 3

c_strMethod · 0.45
readMethod · 0.45
dataMethod · 0.45

Tested by 2

testPipeFunction · 0.40
testFileFunction · 0.40