File indexing completed on 2023-10-03 05:13:51
0001 /* 0002 SPDX-FileCopyrightText: 2016 ROSA 0003 SPDX-License-Identifier: GPL-3.0-or-later 0004 */ 0005 0006 #ifndef PHYSICALDEVICE_H 0007 #define PHYSICALDEVICE_H 0008 0009 //////////////////////////////////////////////////////////////////////////////// 0010 // Class implementing write-only physical device 0011 0012 0013 #include <QFile> 0014 0015 #include "common.h" 0016 0017 class PhysicalDevice : public QFile 0018 { 0019 Q_OBJECT 0020 public: 0021 explicit PhysicalDevice(const QString& name); 0022 0023 // Opens the selected device in WriteOnly mode 0024 virtual bool open(); 0025 0026 protected: 0027 #if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) 0028 int getDescriptor(); 0029 #endif 0030 #if defined(Q_OS_WIN32) 0031 HANDLE m_fileHandle; 0032 #endif 0033 }; 0034 0035 #endif // PHYSICALDEVICE_H