akonadi
Akonadi::ProtocolHelper Class Reference
#include <protocolhelper.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) |
| static int | parseCachePolicy (const QByteArray &data, CachePolicy &policy, int start=0) |
| static int | parseCollection (const QByteArray &data, Collection &collection, int start=0) |
Detailed Description
For internal use only.
Helper methods for converting between libakonadi objects and their protocol representation.
- Todo:
- Add unit tests for this.
- Todo:
- Use exceptions for a useful error handling
Definition at line 36 of file protocolhelper.h.
Member Enumeration Documentation
Member Function Documentation
| QByteArray ProtocolHelper::attributesToByteArray | ( | const Entity & | entity, | |
| bool | ns = false | |||
| ) | [static] |
Convert attributes to their protocol representation.
Definition at line 134 of file protocolhelper.cpp.
| QByteArray ProtocolHelper::cachePolicyToByteArray | ( | const CachePolicy & | policy | ) | [static] |
Convert a cache policy object into its protocol representation.
Definition at line 59 of file protocolhelper.cpp.
| QByteArray ProtocolHelper::decodePartIdentifier | ( | const QByteArray & | data, | |
| PartNamespace & | ns | |||
| ) | [static] |
| QByteArray ProtocolHelper::encodePartIdentifier | ( | PartNamespace | ns, | |
| const QByteArray & | label, | |||
| int | version = 0 | |||
| ) | [static] |
| int ProtocolHelper::parseCachePolicy | ( | const QByteArray & | data, | |
| CachePolicy & | policy, | |||
| int | start = 0 | |||
| ) | [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 31 of file protocolhelper.cpp.
| int ProtocolHelper::parseCollection | ( | const QByteArray & | data, | |
| Collection & | collection, | |||
| int | start = 0 | |||
| ) | [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 75 of file protocolhelper.cpp.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference