File Class

class Qul::PlatformInterface::File

The File class provides an abstract API to implement access to files. More...

Header: #include <platforminterface/filesystem.h>
Since: Qt Quick Ultralite (Platform) 2.6

This class is under development and is subject to change.

Public Types

enum class Mode { ReadOnly }

Public Functions

virtual ~File()
virtual int close() = 0
virtual int read(unsigned char *outputBuffer, uint64_t startOffset, unsigned int size) = 0
virtual uint64_t size() = 0

Detailed Description

This class will be returned by the file system abstraction.

See also Qul::PlatformInterface::Filesystem.

Member Type Documentation

enum class File::Mode

This enum specifies the open modes of a file.

Qul::PlatformInterface::File::Mode::ReadOnly0Open the file in read-only mode.

Currently no write access is required or supported by Qt Quick Ultralite.

Member Function Documentation

[virtual] File::~File()

Destructs the file instance.

This has to be implemented to free up all resources and close the file in the underlying file system.

[pure virtual] int File::close()

Closes the file.

[pure virtual] int File::read(unsigned char *outputBuffer, uint64_t startOffset, unsigned int size)

Reads a block of the file into a provided buffer.

A block starting at startOffset and with a length of size is being read and stored into the provided buffer outputBuffer. The buffer has to be large enough to fit the requested data.

The number of bytes read is returned, or -1 in case of errors.

[pure virtual] uint64_t File::size()

Returns the size of the file.

Available under certain Qt licenses.
Find out more.