akonadi
#include <protocolhelper_p.h>
Public Types | |
enum | PartNamespace { PartGlobal, PartPayload, PartAttribute } |
Static Public Member Functions | |
static QByteArray | attributesToByteArray (const Entity &entity, bool ns=false) |
static QByteArray | cachePolicyToByteArray (const CachePolicy &policy) |
static QByteArray | decodePartIdentifier (const QByteArray &data, PartNamespace &ns) |
static QByteArray | encodePartIdentifier (PartNamespace ns, const QByteArray &label, int version=0) |
template<typename T > | |
static QByteArray | entityIdToByteArray (const T &object, const QByteArray &command) |
template<typename T > | |
static QByteArray | entitySetToByteArray (const QList< T > &_objects, const QByteArray &command) |
static QByteArray | entitySetToByteArray (const QList< Akonadi::Item > &_objects, const QByteArray &command) |
static QByteArray | hierarchicalRidToByteArray (const Collection &col) |
static QByteArray | hierarchicalRidToByteArray (const Item &item) |
static QByteArray | itemFetchScopeToByteArray (const ItemFetchScope &fetchScope) |
static void | parseAncestors (const QByteArray &data, Entity *entity, int start=0) |
static void | parseAncestorsCached (const QByteArray &data, Entity *entity, Collection::Id parentCollection, ProtocolHelperValuePool *valuePool=0, int start=0) |
static int | parseCachePolicy (const QByteArray &data, CachePolicy &policy, int start=0) |
static int | parseCollection (const QByteArray &data, Collection &collection, int start=0) |
static void | parseItemFetchResult (const QList< QByteArray > &lineTokens, Item &item, ProtocolHelperValuePool *valuePool=0) |
Detailed Description
Helper methods for converting between libakonadi objects and their protocol representation.
- Todo:
Add unit tests for this.
Use exceptions for a useful error handling
Definition at line 56 of file protocolhelper_p.h.
Member Enumeration Documentation
Part namespaces.
Definition at line 60 of file protocolhelper_p.h.
Member Function Documentation
|
static |
Convert attributes to their protocol representation.
Definition at line 206 of file protocolhelper.cpp.
|
static |
Convert a cache policy object into its protocol representation.
Definition at line 66 of file protocolhelper.cpp.
|
static |
Decode part label and namespace.
Definition at line 232 of file protocolhelper.cpp.
|
static |
Encodes part label and namespace.
Definition at line 216 of file protocolhelper.cpp.
|
inlinestatic |
Converts the given object identifier into a protocol representation.
- Exceptions
-
A Akonadi::Exception if the item set contains items with missing/invalid identifiers.
Definition at line 194 of file protocolhelper_p.h.
|
inlinestatic |
Converts the given set of items into a protocol representation.
- Exceptions
-
A Akonadi::Exception if the item set contains items with missing/invalid identifiers.
Definition at line 122 of file protocolhelper_p.h.
|
static |
Converts the given collection's hierarchical RID into a protocol representation.
Assumes col
has a valid hierarchical RID, so check that before!
Definition at line 282 of file protocolhelper.cpp.
|
static |
Converts the HRID of the given item into an ASAP protocol representation.
Assumes item
has a valid HRID.
Definition at line 292 of file protocolhelper.cpp.
|
static |
Converts a given ItemFetchScope object into a protocol representation.
Definition at line 298 of file protocolhelper.cpp.
|
static |
Convert a ancestor chain from its protocol representation into an Entity object.
Definition at line 101 of file protocolhelper.cpp.
|
static |
Convert a ancestor chain from its protocol representation into an Entity object.
This method allows to pass a valuePool
which acts as cache, so ancestor paths for the same parentCollection
don't have to be parsed twice.
Definition at line 82 of file protocolhelper.cpp.
|
static |
Parse a cache policy definition.
- Parameters
-
data The input data. policy The parsed cache policy. start Start of the data, ie. postion after the label.
- Returns
- Position in data after the cache policy description.
Definition at line 38 of file protocolhelper.cpp.
|
static |
Parse a collection description.
- Parameters
-
data The input data. collection The parsed collection. start Start of the data.
- Returns
- Position in data after the collection description.
Definition at line 129 of file protocolhelper.cpp.
|
static |
Parses a single line from an item fetch job result into an Item object.
Definition at line 347 of file protocolhelper.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:29 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.