summaryrefslogtreecommitdiff
path: root/src/FileDescriptor.hpp
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-06-12 21:41:41 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-06-13 20:22:51 +0800
commit6f7b994684032060f0a2d7af82f4f3572293b8d6 (patch)
tree793d328cbcd6761365267550b55db45aee9b21fc /src/FileDescriptor.hpp
parent6a51ab4525c59e9fe2bdbd92493019b0a98c6b94 (diff)
internal!: organized internal structure, using cmake now
Diffstat (limited to 'src/FileDescriptor.hpp')
-rw-r--r--src/FileDescriptor.hpp35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/FileDescriptor.hpp b/src/FileDescriptor.hpp
deleted file mode 100644
index 75aeb73..0000000
--- a/src/FileDescriptor.hpp
+++ /dev/null
@@ -1,35 +0,0 @@
-#pragma once
-
-#include <fcntl.h>
-class CFileDescriptor {
- public:
- CFileDescriptor() = default;
- explicit CFileDescriptor(int const fd);
- CFileDescriptor(CFileDescriptor &&) noexcept;
- CFileDescriptor &operator=(CFileDescriptor &&) noexcept;
- ~CFileDescriptor();
-
- CFileDescriptor(const CFileDescriptor &) = delete;
- CFileDescriptor &operator=(const CFileDescriptor &) = delete;
-
- bool operator==(const CFileDescriptor &rhs) const {
- return m_fd == rhs.m_fd;
- }
-
- bool isValid() const;
- int get() const;
- int getFlags() const;
- bool setFlags(int flags);
- int take();
- void reset();
- CFileDescriptor duplicate(int flags = F_DUPFD_CLOEXEC) const;
-
- bool isReadable() const;
- bool isClosed() const;
-
- static bool isReadable(int fd);
- static bool isClosed(int fd);
-
- private:
- int m_fd = -1;
-};