QHttpEngine 0.1.0
Simple and secure HTTP server for Qt applications
Loading...
Searching...
No Matches
Public Member Functions | List of all members
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.
 

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:

if(file.open()) {
file.write("private data");
file.close();
}
Locally accessible file.
Definition qlocalfile.h:54
bool open()
Attempt to open the file.

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: