Go to the documentation of this file.
16 #ifndef SURGSIM_DEVICES_MULTIAXIS_WIN32_FILEHANDLE_H
17 #define SURGSIM_DEVICES_MULTIAXIS_WIN32_FILEHANDLE_H
74 bool readBytes(
void* dataBuffer,
unsigned int bytesToRead,
unsigned int* bytesActuallyRead);
126 #endif // SURGSIM_DEVICES_MULTIAXIS_WIN32_FILEHANDLE_H
bool openForReadingAndMaybeWriting(const std::string &path)
Attempts to open the file handle for reading and (if permissions allow it) writing.
Definition: FileHandle.cpp:124
bool readBytes(void *dataBuffer, unsigned int bytesToRead, unsigned int *bytesActuallyRead)
Reads bytes from the file handle.
Definition: FileHandle.cpp:169
RawHandleType get() const
Gets the raw underlying OS file handle.
Definition: FileHandle.cpp:85
bool openForWriting(const std::string &path)
Attempts to open the file handle for writing only.
Definition: FileHandle.cpp:113
bool m_canWrite
Definition: FileHandle.h:119
~FileHandle()
Destructor.
Definition: FileHandle.cpp:65
void setFileOpenFlags(uint64_t flags)
Sets the flags that will be passed to CreateFile when opening the file.
Definition: FileHandle.cpp:145
Definition: CompoundShapeToGraphics.cpp:30
bool isValid() const
Checks if the file handle is valid, i.e.
Definition: FileHandle.cpp:70
FileHandle(const FileHandle &other)
FileHandle & operator=(const FileHandle &other)
uint64_t m_openFlags
Definition: FileHandle.h:120
bool m_canRead
Definition: FileHandle.h:118
A wrapper for an Windows-style HANDLE file descriptor.
Definition: FileHandle.h:31
void * RawHandleType
Type of the raw handle used by the operating system.
Definition: FileHandle.h:35
bool hasDataToRead() const
Checks whether this object has data available to be read.
Definition: FileHandle.cpp:156
bool openForReading(const std::string &path)
Attempts to open the file handle for reading only.
Definition: FileHandle.cpp:102
uint64_t getFileOpenFlags() const
Gets the flags that will be passed to CreateFile when opening the file.
Definition: FileHandle.cpp:151
RawHandleType m_handle
Definition: FileHandle.h:117
bool canWrite() const
Determines if the file handle can be written to.
Definition: FileHandle.cpp:80
bool canRead() const
Determines if the file handle can be read from.
Definition: FileHandle.cpp:75
FileHandle & operator=(FileHandle &&other)
Move assignment operator.
Definition: FileHandle.cpp:55
void reset()
Resets the file handle back to an invalid state.
Definition: FileHandle.cpp:136
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38
bool openForReadingAndWriting(const std::string &path)
Attempts to open the file handle for reading and writing.
Definition: FileHandle.cpp:91
FileHandle()
Default constructor.
Definition: FileHandle.cpp:38