Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | List of all members
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.

20: handle_(handle) {}

◆ ~Descriptor()

filesystem::Descriptor::~Descriptor ( )
inline

Definition at line 22 of file file.h.

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()

Handle filesystem::Descriptor::get ( )
inline

Definition at line 30 of file file.h.

30{ return handle_; }

◆ is_valid()

bool filesystem::Descriptor::is_valid ( )
inline

Definition at line 28 of file file.h.

28{ return handle_ >= 0; }

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