FileManager Class Reference
The FileManager class assists with AppLnk input/output. More...Public Member Functions | |
| FileManager () | |
| ~FileManager () | |
| bool | saveFile (const DocLnk &, const QByteArray &data) |
| bool | saveFile (const DocLnk &, const QString &text) |
| bool | loadFile (const DocLnk &, QByteArray &data) |
| bool | loadFile (const DocLnk &, QString &text) |
| bool | copyFile (const AppLnk &src, const AppLnk &dest) |
| bool | copyFile (const QString &src, const QString &dest) |
| bool | renameFile (const QString &, const QString &) |
| QIODevice * | openFile (const DocLnk &) |
| QIODevice * | saveFile (const DocLnk &) |
| bool | exists (const DocLnk &) |
Protected Member Functions | |
| bool | ensurePathExists (const QString &fn) |
Detailed Description
The FileManager class assists with AppLnk input/output.
Definition at line 30 of file filemanager.h.
Constructor & Destructor Documentation
|
|
Constructs a FileManager. Definition at line 54 of file filemanager.cpp. |
|
|
Destroys a FileManager. Definition at line 61 of file filemanager.cpp. |
Member Function Documentation
|
||||||||||||
|
Saves data as the document specified by f. Returns whether the operation succeeded. Definition at line 71 of file filemanager.cpp. References QFile::close(), ensurePathExists(), AppLnk::file(), QString::latin1(), QFile::open(), QFile::remove(), QByteArray::size(), QIODevice::writeBlock(), and AppLnk::writeLink(). |
|
||||||||||||
|
Saves text as the document specified by f. The text is saved in UTF8 format. Returns whether the operation succeeded. Definition at line 103 of file filemanager.cpp. References QFile::close(), QByteArray::data(), ensurePathExists(), AppLnk::file(), QString::latin1(), QCString::length(), QFile::open(), QFile::remove(), QString::utf8(), QIODevice::writeBlock(), and AppLnk::writeLink(). |
|
||||||||||||
|
Loads ba from the document specified by f. Returns whether the operation succeeded. Definition at line 162 of file filemanager.cpp. References QFile::close(), QByteArray::data(), AppLnk::file(), QFile::open(), QFile::readBlock(), QByteArray::resize(), and QFile::size(). |
|
||||||||||||
|
Loads text from the document specified by f. The text is required to be in UTF8 format. Returns whether the operation succeeded. Definition at line 138 of file filemanager.cpp. References QFile::close(), AppLnk::file(), QFile::open(), QTextStream::read(), QTextStream::setCodec(), and QTextStream::setEncoding(). |
|
||||||||||||
|
Copies the document specified by src to the document specified by dest. Returns whether the operation succeeded. Definition at line 181 of file filemanager.cpp. References QFile::atEnd(), ensurePathExists(), AppLnk::file(), QString::latin1(), QFile::open(), QFile::readBlock(), QFile::remove(), QIODevice::writeBlock(), and AppLnk::writeLink(). |
|
|
Opens the document specified by f as a readable QIODevice. The caller must delete the return value. Returns 0 if the operation fails. Definition at line 388 of file filemanager.cpp. References AppLnk::file(), and QFile::open(). |
|
|
Opens the document specified by f as a writable QIODevice. The caller must delete the return value. Returns 0 if the operation fails. Definition at line 405 of file filemanager.cpp. References ensurePathExists(), AppLnk::file(), QFile::open(), and AppLnk::writeLink(). |
|
|
Returns whether the document specified by f current exists as a file on disk. Definition at line 423 of file filemanager.cpp. References QFile::exists(), and AppLnk::file(). |
|
|
Ensures that the path fn exists, by creating required directories. Returns TRUE if successful. Definition at line 433 of file filemanager.cpp. References QFileInfo::dirPath(), QFileInfo::exists(), QFileInfo::filePath(), and QFileInfo::setFile(). Referenced by copyFile(), and saveFile(). |
The documentation for this class was generated from the following files:
