|
| static QString | getMD5String (const QString &filename) |
| | Compute the MD5 hash of a file as a hex string.
|
| |
| static QByteArray | getMD5Bytes (const QString &filename) |
| | Compute the MD5 hash of a file as raw bytes.
|
| |
| static bool | readAllBytes (const QString &filename, QByteArray &data) |
| | Read the entire contents of a file into a byte array.
|
| |
| static bool | readAllLines (const QString &filename, QStringList &data, QStringConverter::Encoding encoding=QStringConverter::Utf8) |
| | Read all lines of a text file into a string list.
|
| |
| static bool | writeAllBytes (const QString &filename, const QByteArray &data) |
| | Write a byte array to a file, overwriting any existing content.
|
| |
| static bool | writeAllBytes (const QString &filename, const QByteArray &data, QStringConverter::Encoding encoding) |
| | Write a byte array to a file using a specific text encoding.
|
| |
| static bool | writeAllLines (const QString &filename, const QStringList &lines) |
| | Write a list of strings to a file, one per line.
|
| |
| static bool | appendAllBytes (const QString &filename, const QByteArray &data) |
| | Append a byte array to an existing file (or create if absent).
|
| |
| static int | lineCount (const QString &filename) |
| | Count the number of lines in a text file.
|
| |
| static bool | exists (const QString &filename) |
| | Test whether a file exists.
|
| |
| static bool | remove (const QString &filename) |
| | Remove (delete) a file.
|
| |
| static bool | touch (const QString &filename) |
| | Create an empty file or update its modification time if it exists.
|
| |
| static bool | move (const QString &source, const QString &destination) |
| | Move (rename) a file from one path to another.
|
| |
| static bool | moveToDirectory (const QString &sourceFilename, const QString &destinationDirectory) |
| | Move a file into a destination directory, preserving its basename.
|
| |
| static bool | setModifyTime (const QString &filename, const QDateTime &value) |
| | Set the modification timestamp of a file.
|
| |
| static QString | getTempFilename () |
| | Generate a unique temporary file path.
|
| |
FileUtil.
Some static helper methods for one line file reads / writes and other file manipulations.
Stephen Punak, October 02 2020
Static helper methods for common file I/O operations.
Definition at line 20 of file fileutil.h.