C++ UA Server SDK
1.5.2.336
|
The UaFile class provides an interface for reading from and writing to files. More...
#include <uafile.h>
Inherits UaIODevice.
Inherited by OpcUa::UaTrustListFile.
Public Member Functions | |
virtual OpcUa_Boolean | open (UaIODevice::OpenMode mode) |
Open a file in the mode specified. More... | |
virtual void | close () |
Close a file the was opened before with. More... | |
virtual OpcUa_Int64 | pos () const |
Return the current position to read or write. More... | |
virtual OpcUa_Boolean | seek (OpcUa_Int64 pos) |
Set the current position to the position specified. More... | |
virtual OpcUa_Int64 | size () const |
Returns the size of the file. More... | |
virtual OpcUa_Int64 | read (char *data, OpcUa_Int64 maxSize) |
Reads data from a file opened with open(). More... | |
virtual OpcUa_Int64 | write (const char *data, OpcUa_Int64 size) |
Write data to a file opened with open(). More... | |
virtual OpcUa_Boolean | flush () |
Flushes any buffered data to the file. More... | |
Public Member Functions inherited from UaIODevice | |
virtual OpcUa_Boolean | open (OpenMode mode)=0 |
Open a file in the mode specified. More... | |
Additional Inherited Members | |
Public Types inherited from UaIODevice | |
enum | OpenModeFlag { , OpenModeRead = 0x01, OpenModeWrite = 0x02, OpenModeEraseExisiting = 0x04, OpenModeEraseExisting = 0x04, OpenModeAppend = 0x08, OpenModeText = 0x10 } |
OpenMode enumeration. More... | |
The UaFile class provides an interface for reading from and writing to files.
UaFile is an I/O device for reading and writing text and binary files.
The file name is passed in the constructor.
|
virtual |
|
virtual |
Flushes any buffered data to the file.
Returns true if successful; otherwise returns false.
|
virtual |
Open a file in the mode specified.
Returns true on success; otherwise returns false.
mode | Indicates whether the file should be opened only for read operations or for read and write operations and where the initial position is set. |
|
virtual |
Return the current position to read or write.
Returns true on success; otherwise returns false.
Implements UaIODevice.
|
virtual |
Reads data from a file opened with open().
data | A buffer to store the read data. |
maxSize | The number of elements to read. One element has the size of one char. |
Implements UaIODevice.
|
virtual |
Set the current position to the position specified.
Returns true on success; otherwise returns false.
pos | the position to set. If pos is bigger than the end of the file seek() sets the position to the end of the file. |
Implements UaIODevice.
|
virtual |
Returns the size of the file.
Implements UaIODevice.
|
virtual |
Write data to a file opened with open().
data | A buffer to store the read data. |
size | The number of elements to write. One element has the size of one char. |
Implements UaIODevice.