mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-01 14:41:43 +01:00
Put File, BufferedFile & ErrorCode in the fmt namespace.
This commit is contained in:
@@ -1466,6 +1466,9 @@ TEST(FormatterTest, OutputNotWrittenOnError) {
|
||||
|
||||
#if FMT_USE_FILE_DESCRIPTORS
|
||||
|
||||
using fmt::BufferedFile;
|
||||
using fmt::File;
|
||||
|
||||
TEST(FormatterTest, FileSink) {
|
||||
File read_end, write_end;
|
||||
File::pipe(read_end, write_end);
|
||||
|
||||
@@ -356,6 +356,10 @@ TEST(UtilTest, FormatSystemErrorMessage) {
|
||||
|
||||
#if FMT_USE_FILE_DESCRIPTORS
|
||||
|
||||
using fmt::BufferedFile;
|
||||
using fmt::ErrorCode;
|
||||
using fmt::File;
|
||||
|
||||
// Checks if the file is open by reading one character from it.
|
||||
bool IsOpen(int fd) {
|
||||
char buffer;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#if FMT_USE_FILE_DESCRIPTORS
|
||||
|
||||
#include "posix.cc"
|
||||
using fmt::File;
|
||||
|
||||
void OutputRedirect::Flush() {
|
||||
#if EOF != -1
|
||||
|
||||
@@ -99,8 +99,8 @@ std::string FormatSystemErrorMessage(int error_code, fmt::StringRef message);
|
||||
class OutputRedirect {
|
||||
private:
|
||||
FILE *file_;
|
||||
File original_; // Original file passed to redirector.
|
||||
File read_end_; // Read end of the pipe where the output is redirected.
|
||||
fmt::File original_; // Original file passed to redirector.
|
||||
fmt::File read_end_; // Read end of the pipe where the output is redirected.
|
||||
|
||||
GTEST_DISALLOW_COPY_AND_ASSIGN_(OutputRedirect);
|
||||
|
||||
|
||||
@@ -37,6 +37,10 @@
|
||||
|
||||
#include "gtest-extra.h"
|
||||
|
||||
using fmt::BufferedFile;
|
||||
using fmt::ErrorCode;
|
||||
using fmt::File;
|
||||
|
||||
namespace {
|
||||
int open_count;
|
||||
int close_count;
|
||||
|
||||
Reference in New Issue
Block a user