kodi
FileHandle.h
1 /*
2  * Copyright (C) 2017-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "utils/ScopeGuard.h"
12 
13 #include <unistd.h>
14 
15 namespace KODI
16 {
17 namespace UTILS
18 {
19 namespace POSIX
20 {
21 
22 class CFileHandle : public CScopeGuard<int, -1, decltype(close)>
23 {
24 public:
25  CFileHandle() noexcept : CScopeGuard(close, -1) {}
26  explicit CFileHandle(int fd) : CScopeGuard(close, fd) {}
27 };
28 
29 }
30 }
31 }
Definition: ColorUtils.h:18
Definition: FileHandle.h:22
Definition: AudioDecoder.h:18
Generic scopeguard designed to handle any type of handle.
Definition: ScopeGuard.h:27