MCPcopy Create free account
hub / github.com/apache/thrift / read_file

Function read_file

compiler/cpp/tests/cpp/t_cpp_generator_test_utils.h:40–48  ·  view source on GitHub ↗

Helper function to read file content

Source from the content-addressed store, hash-verified

38
39// Helper function to read file content
40inline std::string read_file(const std::string& filename) {
41 std::ifstream file(filename);
42 if (!file.is_open()) {
43 return "";
44 }
45 std::ostringstream ss;
46 ss << file.rdbuf();
47 return ss.str();
48}
49
50// Get the source directory of the current test file
51inline std::string source_dir() {

Calls 1

strMethod · 0.80

Tested by

no test coverage detected