proxygen
ImmediateFileWriter.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017-present Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 #include <folly/File.h>
19 #include <folly/Range.h>
21 
22 namespace folly {
23 
37  public:
43 
47  explicit ImmediateFileWriter(folly::File&& file);
48 
51  void flush() override;
52 
56  bool ttyOutput() const override {
57  return isatty(file_.fd());
58  }
59 
63  const folly::File& getFile() const {
64  return file_;
65  }
66 
67  private:
70 
72 };
73 } // namespace folly
bool ttyOutput() const override
std::vector< uint8_t > buffer(kBufferSize+16)
flags
Definition: http_parser.h:127
ImmediateFileWriter & operator=(ImmediateFileWriter const &)=delete
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
const folly::File & getFile() const
int fd() const
Definition: File.h:85
ImmediateFileWriter(folly::StringPiece path)
virtual void writeMessage(folly::StringPiece buffer, uint32_t flags=0)=0
void writeMessage(folly::StringPiece buffer, uint32_t flags=0) override