Akonadi::Server::PartHelper
Functions | |
bool | insert (Part *part, qint64 *insertId=nullptr) |
bool | remove (Part *part) |
bool | remove (const QString &column, const QVariant &value) |
QByteArray | translateData (const QByteArray &data, Part::Storage storageType) |
QByteArray | translateData (const Part &part) |
bool | truncate (Part &part) |
void | update (Part *part, const QByteArray &data, qint64 dataSize) |
bool | verify (Part &part) |
Detailed Description
Helper methods that store data in a file instead of the database.
- Todo:
- Use exceptions for error handling in all these methods. Requires that all callers can handle that first though.
Function Documentation
bool Akonadi::Server::PartHelper::insert | ( | Part * | part, |
qint64 * | insertId = nullptr |
||
) |
Adds a new part to the database and if necessary to the filesystem.
part
must not be in the database yet (ie. valid() == false) and must have a data size set.
Definition at line 58 of file parthelper.cpp.
bool Akonadi::Server::PartHelper::remove | ( | Part * | part | ) |
Deletes part
from the database and also removes existing filesystem data if needed.
Definition at line 90 of file parthelper.cpp.
Deletes all parts which match the given constraint, including all corresponding filesystem data.
Definition at line 102 of file parthelper.cpp.
QByteArray Akonadi::Server::PartHelper::translateData | ( | const QByteArray & | data, |
Part::Storage | storageType | ||
) |
Returns the payload data.
Definition at line 122 of file parthelper.cpp.
QByteArray Akonadi::Server::PartHelper::translateData | ( | const Part & | part | ) |
Convenience overload of the above.
Definition at line 147 of file parthelper.cpp.
bool Akonadi::Server::PartHelper::truncate | ( | Part & | part | ) |
Truncate the payload of part
and update filesystem/database accordingly.
This is more efficient than using update since it does not require the data to be loaded.
Definition at line 152 of file parthelper.cpp.
void Akonadi::Server::PartHelper::update | ( | Part * | part, |
const QByteArray & | data, | ||
qint64 | dataSize | ||
) |
Update payload of an existing part part
to data
and size dataSize
.
Automatically decides whether or not the data should be stored in the database or the file system.
- Exceptions
-
PartHelperException if file operations failed
Definition at line 22 of file parthelper.cpp.
bool Akonadi::Server::PartHelper::verify | ( | Part & | part | ) |
Verifies and if necessary fixes the external reference of this part.
Definition at line 164 of file parthelper.cpp.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Mar 3 2021 00:16:51 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.