MCPcopy Create free account
hub / github.com/apache/brpc / ReadTextFile

Function ReadTextFile

test/file_util_unittest.cc:256–264  ·  view source on GitHub ↗

Simple function to take out some text from a file.

Source from the content-addressed store, hash-verified

254
255// Simple function to take out some text from a file.
256std::wstring ReadTextFile(const FilePath& filename) {
257 wchar_t contents[64];
258 std::wifstream file;
259 file.open(filename.value().c_str());
260 EXPECT_TRUE(file.is_open());
261 file.getline(contents, arraysize(contents));
262 file.close();
263 return std::wstring(contents);
264}
265
266#if defined(OS_WIN)
267uint64_t FileTimeAsUint64(const FILETIME& ft) {

Callers 1

TEST_FFunction · 0.85

Calls 3

closeMethod · 0.80
c_strMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected