LeechCraft 0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
fdguard.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 * Copyright (C) 2012 Maxim Ignatenko
5 *
6 * Distributed under the Boost Software License, Version 1.0.
7 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
8 **********************************************************************/
9
10#pragma once
11
12#include "sysconfig.h"
13
14namespace LC::Util
15{
17 {
18 int FD_;
19 public:
20 FDGuard (const char *file, int mode);
21 FDGuard (const FDGuard&) = delete;
22 FDGuard (FDGuard&& other);
23 ~FDGuard ();
24
25 FDGuard& operator= (const FDGuard&) = delete;
26 FDGuard& operator= (FDGuard&& other);
27
28 explicit operator bool () const;
29 explicit (false) operator int () const;
30
31 friend void swap (FDGuard& g1, FDGuard& g2);
32 };
33}
FDGuard(const FDGuard &)=delete
void swap(FDGuard &g1, FDGuard &g2)
Definition fdguard.cpp:51
#define UTIL_SYS_API
Definition sysconfig.h:16