Flutter Engine
filesystem::Descriptor Class Reference

#include <file.h>

Public Types

using Handle = int
 

Public Member Functions

 Descriptor (Handle handle)
 
 ~Descriptor ()
 
bool is_valid ()
 
Handle get ()
 

Detailed Description

Definition at line 16 of file file.h.

Member Typedef Documentation

◆ Handle

Definition at line 18 of file file.h.

Constructor & Destructor Documentation

◆ Descriptor()

filesystem::Descriptor::Descriptor ( Handle  handle)
inline

Definition at line 20 of file file.h.

Referenced by get().

20 : handle_(handle) {}

◆ ~Descriptor()

filesystem::Descriptor::~Descriptor ( )
inline

Definition at line 22 of file file.h.

References IGNORE_EINTR, and is_valid().

22  {
23  if (is_valid()) {
24  IGNORE_EINTR(::close(handle_));
25  }
26  }
#define IGNORE_EINTR(x)
Definition: eintr_wrapper.h:46

Member Function Documentation

◆ get()

◆ is_valid()

bool filesystem::Descriptor::is_valid ( )
inline

Definition at line 28 of file file.h.

Referenced by filesystem::ReadFileToBytes(), and ~Descriptor().

28 { return handle_ >= 0; }

The documentation for this class was generated from the following file: