MCPcopy Create free account
hub / github.com/fmtlib/fmt / open_buffered_file

Function open_buffered_file

test/util.cc:14–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12const char* const file_content = "Don't panic!";
13
14fmt::buffered_file open_buffered_file(FILE** fp) {
15#if FMT_USE_FCNTL
16 auto pipe = fmt::pipe();
17 pipe.write_end.write(file_content, std::strlen(file_content));
18 pipe.write_end.close();
19 fmt::buffered_file f = pipe.read_end.fdopen("r");
20 if (fp) *fp = f.get();
21#else
22 fmt::buffered_file f("test-file", "w");
23 fputs(file_content, f.get());
24 if (fp) *fp = f.get();
25#endif
26 return f;
27}
28
29std::locale do_get_locale(const char* name) {
30 try {

Callers 1

TESTFunction · 0.70

Calls 4

writeMethod · 0.45
closeMethod · 0.45
fdopenMethod · 0.45
getMethod · 0.45

Tested by 1

TESTFunction · 0.56