kodi
xbmc
platform
posix
utils
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
}
UTILS
Definition:
ColorUtils.h:18
KODI::UTILS::POSIX::CFileHandle
Definition:
FileHandle.h:22
KODI
Definition:
AudioDecoder.h:18
KODI::UTILS::CScopeGuard
Generic scopeguard designed to handle any type of handle.
Definition:
ScopeGuard.h:27
Generated by
1.8.13