MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / read_file

Function read_file

performance-tests/bench/node_controller/main.cpp:78–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78void read_file(std::ifstream& ifs, ::TAO::String_Manager& str)
79{
80 ifs.seekg(0, ios::end);
81 const std::ifstream::pos_type end_pos = ifs.tellg();
82 ifs.seekg(0, ios::beg);
83 const std::ifstream::pos_type beg_pos = ifs.tellg();
84
85 const auto file_length = end_pos - beg_pos;
86
87 std::vector<char> temp(static_cast<std::vector<char>::size_type>(file_length + 1));
88 ifs.read(temp.data(), file_length);
89 temp[static_cast<std::vector<char>::size_type>(file_length)] = '\0';
90
91 const char* ptr = temp.data();
92 str = ptr;
93}
94
95class SpawnedProcess {
96public:

Callers 2

Calls 2

readMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected