Collaboration diagram for Data Tranformation functions:
![]() |
Modules | |
Static SIF Fields tables | |
VObject conversion functions | |
Functions | |
WinItem * | createWinItem (bool useSIF, const std::wstring itemType) |
Creates an empty WinItem object of the desired type (Client to Server). | |
WinItem * | createWinItem (bool useSIF, const std::wstring itemType, const std::wstring &data, const WCHAR **sifFields) |
Creates and fills a WinItem object of the desired type (Server to Client). | |
SyncItem * | convertToSyncItem (ClientItem *cItem, const char *dataType, const std::wstring &defaultFolder) |
ClientItem object -> SyncItem object (client to server). | |
int | fillClientItem (const std::wstring &sif, ClientItem *cItem, const std::wstring &itemType, const WCHAR *dataType) |
data string (SIF/VCard/. | |
std::wstring | formatAppExceptions (ClientAppointment *cApp) |
Format appointment exceptions (client to server). | |
int | parseAppExceptions (const std::wstring &sifString, ClientItem *cItem) |
Parse appointment exceptions from SIF data (server to client). | |
int | checkFreeOccurrence (ClientAppointment *cApp, const std::wstring &sifString, const std::wstring &originalDate) |
WCHAR ** | getProperSifArray (const std::wstring &type) |
Utility to return the right pointer to the static WCHAR** array of SIF fields, given the 'type' itemType. | |
int | normalizeExceptions (ClientItem *cItem, itemKeyList &allItems, itemKeyList &allItemsPaths) |
Normalize all appointment exceptions for passed item (client to server). | |
int | deleteOccurrencesInInterval (const DATE startDate, const DATE originalDate, ClientRecurrence *cRec) |
Deletes all existing occurrences in the interval [startDate - originalDate[ , from ClientRecurrence object 'cRec'. | |
int | setRecurrenceExceptions (ClientItem *cItem, std::list< std::wstring > &excludeDates, std::list< std::wstring > &includeDates) |
int | checkIllegalXMLChars (char *data) |
Check for illegal XML chars inside 'data'. | |
std::wstring | getVPropertyValue (const std::wstring &dataString, const std::wstring &propertyName) |
Get a property value from a string formatted vCard / vCalendar. | |
void | addPropertyToSIF (const std::wstring propertyName, std::wstring propertyValue, std::wstring &sif) |
Adds a tag <PropertyName>PropertyValue</PropertyName> into sifString. | |
std::wstring | adaptToSIFSpecs (const std::wstring &propName, const std::wstring &propValue, const std::wstring &type) |
Transform the value of the specified property according to the SIF specifications. | |
std::wstring | adaptFromSIFSpecs (const std::wstring &propName, const std::wstring &propValue, const std::wstring &type) |
Transform the value of the specified property found in SIF structure to the one expected by outlook. | |
void | replaceDefaultPath (std::wstring &path, const std::wstring &defaultFolder) |
Replaces the 'defaultFolder' string with "DEFAULT_FOLDER" inside 'path'. |
std::wstring adaptFromSIFSpecs | ( | const wstring & | propName, | |
const wstring & | propValue, | |||
const wstring & | type | |||
) |
Transform the value of the specified property found in SIF structure to the one expected by outlook.
The values are formatted following the vcard and icalendar specs that in some cases they are different from the SIF expectations. If there are no differences the same value is returned.
propName | [IN] the property name | |
propValue | [IN] the property value | |
type | [IN] the type of the data (contact, calendar...) |
std::wstring adaptToSIFSpecs | ( | const wstring & | propName, | |
const wstring & | propValue, | |||
const wstring & | type | |||
) |
Transform the value of the specified property according to the SIF specifications.
The values are formatted following the vcard and icalendar specs that in some cases they are different from the SIF expectations. If there are no differences, propValue is returned.
propName | [IN] the property name | |
propValue | [IN] the property value | |
type | [IN] the type of the data (contact, calendar...) |
int checkIllegalXMLChars | ( | char * | data | ) |
Check for illegal XML chars inside 'data'.
Chars < 0x20 are converted to 0x21 (space) - preserved '' '
' ''.
data | [IN/OUT] the buffer to analyze |
SyncItem* convertToSyncItem | ( | ClientItem * | cItem, | |
const char * | dataType, | |||
const wstring & | defaultFolder | |||
) |
ClientItem object -> SyncItem object (client to server).
SyncItem data is the string generated from all ClientItem properties. Data is converted into SIF or other mime types, based on 'dataType' parameter.
cItem | [INPUT] pointer to ClientItem | |
dataType | the mime type of data we want into the SyncItem (SIF/VCard/...) | |
defaultFolder | the default folder path for this syncsource |
WinItem* createWinItem | ( | bool | useSIF, | |
const wstring | itemType, | |||
const wstring & | data, | |||
const WCHAR ** | sifFields | |||
) |
Creates and fills a WinItem object of the desired type (Server to Client).
Fills the WinItem map parsing the passed 'data' wstring.
useSIF | true if we use SIF data | |
itemType | the item type ("contact", "task", ...) | |
data | the data input string to parse | |
sifFields | pointer to the static array of SIF fields used |
WinItem* createWinItem | ( | bool | useSIF, | |
const wstring | itemType | |||
) |
Creates an empty WinItem object of the desired type (Client to Server).
useSIF | true if we use SIF data | |
itemType | the item type ("contact", "task", ...) |
int deleteOccurrencesInInterval | ( | const DATE | startDate, | |
const DATE | originalDate, | |||
ClientRecurrence * | cRec | |||
) |
Deletes all existing occurrences in the interval [startDate - originalDate[ , from ClientRecurrence object 'cRec'.
When an occurrence is found in the given interval, a proper exception is added to 'cRec' (a 'deleted occurrence' exception).
startDate | : the start date (included in interval) | |
originalDate | : the original date (excluded from interval) | |
cRec | : the ClientRecurrence pointer to work on |
int fillClientItem | ( | const wstring & | data, | |
ClientItem * | cItem, | |||
const wstring & | itemType, | |||
const WCHAR * | dataType | |||
) |
data string (SIF/VCard/.
..) -> ClientItem (server to client). Fill the passed ClientItem object with all properties from 'data' string. Data is parsed from SIF or other mime types, based on 'dataType' parameter.
data | : the input string to read from | |
cItem | : [IN-OUT] the ClientItem object to fill | |
itemType | : the type of item (contact/task/...) | |
dataType | : the mime type of data sent by server |
std::wstring formatAppExceptions | ( | ClientAppointment * | cApp | ) |
Format appointment exceptions (client to server).
cApp | the ClientAppointment pointer to retrieve data |
std::wstring getVPropertyValue | ( | const wstring & | dataString, | |
const wstring & | propertyName | |||
) |
Get a property value from a string formatted vCard / vCalendar.
Parses the string, and returns the property value from the passed name.
dataString | the input string (vCard/vCalendar) | |
propertyName | the name of property to retrieve |
int normalizeExceptions | ( | ClientItem * | cItem, | |
itemKeyList & | allItems, | |||
itemKeyList & | allItemsPaths | |||
) |
Normalize all appointment exceptions for passed item (client to server).
This is done before sending items to server. After normalization we will have only exceptions that are 'deleted occurrences', and new unlinked appointments for other exceptions. New appointments are also added to the 'allItems' list. In case of errors, 'lastErrorMsg' is set and '1' is returned.
allItems | : [IN-OUT] the list of all appointments to scan |
int parseAppExceptions | ( | const wstring & | sifString, | |
ClientItem * | cItem | |||
) |
Parse appointment exceptions from SIF data (server to client).
Lists of exceptions are created and passed to 'setRecurrenceExceptions()' function.
sifString | : the SIF string to read from | |
cItem | : the ClientItem object to modify (it's an appointment) |
void replaceDefaultPath | ( | wstring & | path, | |
const wstring & | defaultFolder | |||
) |
Replaces the 'defaultFolder' string with "DEFAULT_FOLDER" inside 'path'.
We need to temporary add a "\" char at the end, to avoid replacing folders names such as "\\Personal Folder\Contacts2" into "DEFAULT_FOLDER2".
path | the wstring to search (IN/OUT: it can be modified here) | |
defaultFolder | the wstring to search for |