Go to the documentation of this file.
23 #define XS_DEFAULT_READ_BUFFER_SIZE (XS_MAXMSGLEN * 8)
25 #define XS_DEFAULT_WRITE_BUFFER_SIZE XS_MAXMSGLEN
28 #define XS_MAX_FILENAME_LENGTH 512
30 #define XS_MAX_FILENAME_LENGTH PATH_MAX
36 #define XsIoHandle HANDLE
38 #define XsFileHandle FILE
60 virtual bool isOpen(
void)
const = 0;
111 const XsString& filename,
bool createNew,
bool readOnly);
virtual XsResultValue getName(XsString &filename) const
Retrieve the filename that was last successfully opened.
#define XsIoHandle
The type that is used for low-level identification of an open I/O device.
virtual XsResultValue setTimeout(uint32_t ms)
Set the default timeout value to use in blocking operations.
virtual XsResultValue find(const XsByteArray &needleV, XsFilePos &pos)
Find a string of bytes in the file.
virtual ~IoInterface()
Destructor.
struct XsByteArray XsByteArray
virtual XsFilePos getWritePosition(void) const
Return the current write position.
virtual XsResultValue open(const XsPortInfo &portInfo, uint32_t readBufSize=XS_DEFAULT_READ_BUFFER_SIZE, uint32_t writeBufSize=XS_DEFAULT_WRITE_BUFFER_SIZE)
Open a communication channel to the given port info.
virtual XsResultValue create(const XsString &filename)
Create an empty file.
#define XS_DEFAULT_READ_BUFFER_SIZE
The default size of the serial read buffer in bytes.
GLuint GLsizei GLsizei * length
XsResultValue
Xsens result values.
virtual bool isOpen(void) const =0
Returns true if the object has a connection to a device.
#define XS_DEFAULT_WRITE_BUFFER_SIZE
The default size of the serial write buffer in bytes.
virtual XsResultValue insertData(XsFilePos start, const XsByteArray &data)
Insert the given data into the file.
GLsizei GLsizei GLenum GLenum const GLvoid * data
virtual XsResultValue deleteData(XsFilePos start, XsSize length)
Delete the given data from the file.
virtual void cancelIo(void) const
Cancel any pending io requests.
size_t XsSize
XsSize must be unsigned number!
virtual XsResultValue readData(XsSize maxLength, XsByteArray &data)=0
Read at most maxLength bytes from the device into data.
virtual XsResultValue setWritePosition(XsFilePos pos=-1)
Set the new absolute write position.
virtual XsFilePos getFileSize(void) const
Return the size of the file.
#define XSENS_DISABLE_COPY(className)
Add this macro to the start of a class definition to prevent automatic creation of copy functions.
virtual XsResultValue writeData(const XsByteArray &data, XsSize *written=nullptr)=0
Write the data contained in data to the device.
An abstract IO interface.
virtual XsFilePos getReadPosition(void) const
Return the current read position.
virtual XsResultValue close(void)=0
Close the connection to the device.
IoInterface()
Constructor.
virtual bool isReadOnly(void) const
Return whether the file is readonly or not.
virtual XsResultValue getLastResult(void) const =0
Returns the last result value produced by this interface.
virtual XsResultValue waitForData(XsSize maxLength, XsByteArray &data)
Wait for data to arrive or a timeout to occur.
virtual XsResultValue setReadPosition(XsFilePos pos)
Set the new absolute read position.
__int64 XsFilePos
The type that is used for positioning inside a file.
virtual XsResultValue closeAndDelete(void)
Close the file and delete it.
unsigned __int32 uint32_t
virtual XsResultValue flushData(void)=0
Flush all data in the buffers to and from the device.
virtual XsResultValue appendData(const XsByteArray &bdata)
Write data to the end of the file.
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |