QLocalFile Class Reference

Locally accessible file. More...

`#include <QHttpEngine/QLocalFile>`

Inheritance diagram for QLocalFile:

## Public Member Functions

| QLocalFile (QObject *parent=0)
| Create a new local file.
bool | open ()
| Attempt to open the file. More...

## Detailed Description

QLocalFile uses platform-specific functions to create a file containing information that will be accessible only to the local user. This is typically used for storing authentication tokens:

QLocalFile file;
if(file.open()) {
file.write("private data");
file.close();
}

By default, the file is stored in the user's home directory and the name of the file is derived from the value of QCoreApplication::applicationName(). For example, if the application name was "test" and the user's home directory was `/home/bob`, the absolute path would be `/home/bob/.test`.

## Member Function Documentation

## open()

bool QLocalFile::open | ( |  | ) |

The file must be opened before data can be read or written. This method will return false if the underlying file could not be opened or if this class was unable to set the appropriate file permissions.

The documentation for this class was generated from the following file:

- qlocalfile.h

QLocalFile::open
bool open()
Attempt to open the file.
QLocalFile
Locally accessible file.
Definition: qlocalfile.h:53