File indexing completed on 2025-04-20 10:58:28
0001 /* 0002 KWin - the KDE window manager 0003 This file is part of the KDE project. 0004 0005 SPDX-FileCopyrightText:: 2022 Xaver Hugl <xaver.hugl@gmail.com> 0006 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 #pragma once 0010 0011 #include <kwin_export.h> 0012 0013 namespace KWin 0014 { 0015 0016 class KWIN_EXPORT FileDescriptor 0017 { 0018 public: 0019 FileDescriptor() = default; 0020 explicit FileDescriptor(int fd); 0021 FileDescriptor(FileDescriptor &&); 0022 FileDescriptor &operator=(FileDescriptor &&); 0023 ~FileDescriptor(); 0024 0025 bool isValid() const; 0026 int get() const; 0027 FileDescriptor duplicate() const; 0028 0029 private: 0030 int m_fd = -1; 0031 }; 0032 0033 }