Reading Meta-Data
[API's]


Detailed Description

HotSync uses these functions to read the DataStore's capabilities and WBXML string tables. Each DataStore must declare its supported content (mime) types and other capabilities in an XML string that conforms to the DataStore and CT Cap elements of the SyncML 1.2 Device Information specification. Each DataStore may associate a WBXML string table with each of its supported content types. HotSync uses this table to generate binary tags for commonly occuring content elements, thus reducing the transmission size of the content.

Capabilities and string tables are both versioned. The implementing DataStore should increment the relevant version whenever the corresponding object has changed; for example, when the DataStore supports a new mime type it should increment its capabilities version. When HotSync notices that its version of either the capabilities or a content type string table is not current, it will use these APIs to reread the relevant data.


Functions

alp_status_t alp_hsds_is_version_current (AlpHsDataStoreHandle hDs, AlpHsDataStoreVersionType type, uint32_t version, bool *isCurrent)
 Determine whether the capabilities or string table version is current.
alp_status_t alp_hsds_read_capabilities (AlpHsDataStoreHandle hDs, uint32_t *pCurrentVersion, size_t *pSize, _TCHAR *pBuffer)
 Read the DataStore's capabilities.
alp_status_t alp_hsds_read_string_table (AlpHsDataStoreHandle hDs, AlpHsObjectTypePtr pObjType, uint32_t *pCurrentVersion, size_t *pSize, _TCHAR *pBuffer)
 Read the DataStore's WBXML string table for the input object type.


Function Documentation

alp_status_t alp_hsds_is_version_current AlpHsDataStoreHandle  hDs,
AlpHsDataStoreVersionType  type,
uint32_t  version,
bool *  isCurrent
 

Determine whether the capabilities or string table version is current.

Parameters:
[in] hDs Handle to an open datastore
[in] type The version type (capabilities or string table)
[in] version The caller's version number
[out] isCurrent True if the caller's version is the same as the current version; false otherwise
Remarks:
The implementation should set *isCurrent to false when the input version is zero.
Returns:
If successful returns ALP_STATUS_HOTSYNC_OK; otherwise returns an error.

alp_status_t alp_hsds_read_capabilities AlpHsDataStoreHandle  hDs,
uint32_t *  pCurrentVersion,
size_t *  pSize,
_TCHAR *  pBuffer
 

Read the DataStore's capabilities.

Parameters:
[in] hDs Handle to an open datastore
[out] pCurrentVersion The current capabilities version
[in,out] pSize On input, the size of *pBuffer; on output, the number of bytes written to *pBuffer
[in,out] pBuffer Buffer to receive the datastore capabilites
Remarks:
The buffer is allocated by the caller. When pBuffer is null, the implementation should return the size of the capabilities in *pSize. This usage allows the caller to allocate a buffer of the correct size.
Returns:
If successful returns ALP_STATUS_HOTSYNC_OK; otherwise returns an error.

alp_status_t alp_hsds_read_string_table AlpHsDataStoreHandle  hDs,
AlpHsObjectTypePtr  pObjType,
uint32_t *  pCurrentVersion,
size_t *  pSize,
_TCHAR *  pBuffer
 

Read the DataStore's WBXML string table for the input object type.

The table is simply a series of null terminated strings that is terminated by two null characters.

Parameters:
[in] hDs Handle to an open datastore
[in] pObjType Identifies the target object type.
[out] pCurrentVersion The current string table version
[in,out] pSize On input, the size of *pBuffer; on output, the number of bytes written to *pBuffer
[in,out] pBuffer Buffer to receive the datastore's string table
Remarks:
The buffer is allocated by the caller. When pBuffer is null, the implementation should return the size of the capabilities in *pSize. This usage allows the caller to allocate a buffer of the correct size.
Returns:
If successful returns ALP_STATUS_HOTSYNC_OK; otherwise returns an error.


Generated on Wed Jul 30 07:06:41 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.