Quark  0.1
FileUtils Class Reference

A collection of file utility functions. More...

#include <FileUtils.h++>

Static Public Member Functions

static QString readFileToString (const QString &path)
 Reads the contents of a file into a string. More...
 
static void writeStringToFile (const QString &path, const QString &text)
 Writes a string to a file. More...
 
static QByteArray computeMD5 (const QString &path)
 Computes the MD5 digest for a file. More...
 
static bool createFile (const QString &path)
 Creates an empty file. More...
 

Detailed Description

A collection of file utility functions.

Author
Mark Lindner

Member Function Documentation

◆ computeMD5()

static QByteArray computeMD5 ( const QString &  path)
static

Computes the MD5 digest for a file.

Parameters
pathThe path to the file.
Returns
The MD5 digest for the file, as a byte array.

◆ createFile()

static bool createFile ( const QString &  path)
static

Creates an empty file.

Parameters
pathThe path to the file.
Returns
true if the file was successfully created or it already existed; false otherwise.

◆ readFileToString()

static QString readFileToString ( const QString &  path)
static

Reads the contents of a file into a string.

Parameters
pathThe path to the file.
Returns
A string containing the contents of the file.

◆ writeStringToFile()

static void writeStringToFile ( const QString &  path,
const QString &  text 
)
static

Writes a string to a file.

If the file already exists, it is truncated and overwritten.

Parameters
pathThe path to the file.
textThe text to write to the file.

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