src: replace naive search in Buffer::IndexOf
[platform/upstream/nodejs.git] / src / tty_wrap.h
1 #ifndef SRC_TTY_WRAP_H_
2 #define SRC_TTY_WRAP_H_
3
4 #include "env.h"
5 #include "handle_wrap.h"
6 #include "stream_wrap.h"
7
8 namespace node {
9
10 class TTYWrap : public StreamWrap {
11  public:
12   static void Initialize(v8::Local<v8::Object> target,
13                          v8::Local<v8::Value> unused,
14                          v8::Local<v8::Context> context);
15
16   uv_tty_t* UVHandle();
17
18   size_t self_size() const override { return sizeof(*this); }
19
20  private:
21   TTYWrap(Environment* env,
22           v8::Local<v8::Object> object,
23           int fd,
24           bool readable);
25
26   static void GuessHandleType(const v8::FunctionCallbackInfo<v8::Value>& args);
27   static void IsTTY(const v8::FunctionCallbackInfo<v8::Value>& args);
28   static void GetWindowSize(const v8::FunctionCallbackInfo<v8::Value>& args);
29   static void SetRawMode(const v8::FunctionCallbackInfo<v8::Value>& args);
30   static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
31
32   uv_tty_t handle_;
33 };
34
35 }  // namespace node
36
37 #endif  // SRC_TTY_WRAP_H_