Modernize AutoCloseFD
This commit is contained in:
		
							parent
							
								
									8a41792d43
								
							
						
					
					
						commit
						cb5e7254b6
					
				
					 11 changed files with 139 additions and 153 deletions
				
			
		|  | @ -164,16 +164,18 @@ public: | |||
| class AutoCloseFD | ||||
| { | ||||
|     int fd; | ||||
|     void close(); | ||||
| public: | ||||
|     AutoCloseFD(); | ||||
|     AutoCloseFD(int fd); | ||||
|     AutoCloseFD(const AutoCloseFD & fd); | ||||
|     AutoCloseFD(const AutoCloseFD & fd) = delete; | ||||
|     AutoCloseFD(AutoCloseFD&& fd); | ||||
|     ~AutoCloseFD(); | ||||
|     void operator =(int fd); | ||||
|     operator int() const; | ||||
|     void close(); | ||||
|     bool isOpen(); | ||||
|     int borrow(); | ||||
|     AutoCloseFD& operator =(const AutoCloseFD & fd) = delete; | ||||
|     AutoCloseFD& operator =(AutoCloseFD&& fd); | ||||
|     int get() const; | ||||
|     explicit operator bool() const; | ||||
|     int release(); | ||||
| }; | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue