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

Function CreateTextFile

test/file_util_unittest.cc:246–253  ·  view source on GitHub ↗

Simple function to dump some text into a new file.

Source from the content-addressed store, hash-verified

244
245// Simple function to dump some text into a new file.
246void CreateTextFile(const FilePath& filename,
247 const std::wstring& contents) {
248 std::wofstream file;
249 file.open(filename.value().c_str());
250 ASSERT_TRUE(file.is_open());
251 file << contents;
252 file.close();
253}
254
255// Simple function to take out some text from a file.
256std::wstring ReadTextFile(const FilePath& filename) {

Callers 2

TEST_FFunction · 0.85

Calls 3

closeMethod · 0.80
c_strMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected