QHttpEngine  1.0.0
Simple and secure HTTP server for Qt applications
Public Member Functions | Friends | List of all members
QHttpEngine::LocalFile Class Reference

Locally accessible file. More...

#include <qhttpengine/localfile.h>

Inheritance diagram for QHttpEngine::LocalFile:

Public Member Functions

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

Friends

class LocalFilePrivate
 

Detailed Description

LocalFile 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();
}

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 QHttpEngine::LocalFile::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: