OpenAB  1.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
OpenAB::PIMContactItemIndex Class Reference

Documentation for class PIMContactItemIndex. It implements PIMItemIndex for OpenAB::eContact type, additionally allows to define which PIMItemCheck should be used to construct PIMContactItemIndex objects. More...

#include <PIMContactItemIndex.hpp>

Inheritance diagram for OpenAB::PIMContactItemIndex:
Collaboration diagram for OpenAB::PIMContactItemIndex:

Public Member Functions

 PIMContactItemIndex ()
 Constructor. More...
 
virtual ~PIMContactItemIndex ()
 Destructor, virtual by default. More...
 
bool operator== (const PIMItemIndex &other) const
 Compare operator. Checks if two PIMItemIndex matches (may not be exactly the same) More...
 
bool operator!= (const PIMItemIndex &other) const
 Compare operator. Checks if two PIMItemIndex not matches (are totally different) More...
 
bool operator< (const PIMItemIndex &other) const
 Compare operator. More...
 
bool operator== (const PIMContactItemIndex &other) const
 Compare operator. Checks if two PIMItemIndex matches (may not be exactly the same) More...
 
bool operator!= (const PIMContactItemIndex &other) const
 Compare operator. Checks if two PIMItemIndex not matches (are totally different) More...
 
bool operator< (const PIMContactItemIndex &other) const
 Compare operator. More...
 
bool compare (const PIMItemIndex &other) const
 Compares two PIMItemIndex object, checks if two PIMItemIndex are exactly the same. In opposite to compare operator it checks PIMItemCheck::eConflict fields. More...
 
bool compare (const PIMContactItemIndex &other) const
 Compares two PIMContactItemIndex object, in opposite to compare operator it checks also PIMItemCheck::eConflict fields. Checks if two PIMContactItemIndex are exactly the same. More...
 
std::string toString () const
 Returns string version of PIMItemIndex. It contains only PIMItemCheck::eKey fields. More...
 
std::string toStringFull () const
 Returns string version of PIMItemIndex. It contains both PIMItemCheck::eKey and PIMItemCheck::eConflict fields. More...
 
- Public Member Functions inherited from OpenAB::PIMItemIndex
 PIMItemIndex (OpenAB::PIMItemType t)
 Constructor. More...
 
virtual ~PIMItemIndex ()
 Destructor, virtual by default. More...
 
virtual void addKeyField (const std::string &name, const std::string &value)
 Adds new PIMItemCheck::eKey field. More...
 
virtual void addConflictField (const std::string &name, const std::string &value)
 Adds new PIMItemCheck::eConflict field. More...
 
OpenAB::PIMItemType getType () const
 Returns type of item that index is representing. More...
 

Static Public Member Functions

static bool addCheck (const std::string &fieldName, PIMItemCheck::eFieldRole role)
 Defines new PIMItemCheck for PIMContactItem objects. More...
 
static bool removeCheck (const std::string &fieldName)
 Removes check for PIMContactItem objects. More...
 
static bool disableCheck (const std::string &fieldName)
 Disables PIMItemCheck for PIMContactItem objects. More...
 
static bool enableCheck (const std::string &fieldName)
 Enables PIMItemCheck for PIMContactItem objects. More...
 
static void enableAllChecks ()
 Enables all PIMItemCheck for PIMContactItem objects. More...
 
static void clearAllChecks ()
 Removes all defined PIMItemCheck for PIMContactItem. More...
 
static std::vector< PIMItemCheckgetAllChecks ()
 Returns all defined PIMItemCheck for PIMContactItem objects. More...
 

Additional Inherited Members

- Protected Member Functions inherited from OpenAB::PIMItemIndex
bool compareVectors (const std::vector< std::string > &v1, const std::vector< std::string > &v2) const
 
- Protected Attributes inherited from OpenAB::PIMItemIndex
std::vector< std::string > key_fields
 
std::vector< std::string > conflict_fields
 
std::vector< std::string > key_fields_names
 
std::vector< std::string > conflict_fields_names
 
std::string cached_to_string
 

Detailed Description

Documentation for class PIMContactItemIndex. It implements PIMItemIndex for OpenAB::eContact type, additionally allows to define which PIMItemCheck should be used to construct PIMContactItemIndex objects.

Constructor & Destructor Documentation

OpenAB::PIMContactItemIndex::PIMContactItemIndex ( )

Constructor.

OpenAB::PIMContactItemIndex::~PIMContactItemIndex ( )
virtual

Destructor, virtual by default.

Member Function Documentation

bool OpenAB::PIMContactItemIndex::addCheck ( const std::string &  fieldName,
PIMItemCheck::eFieldRole  role 
)
static

Defines new PIMItemCheck for PIMContactItem objects.

Parameters
[in]fieldNamename of vCard field to be checked
[in]rolerole of field check
Returns
true if new check was added successfully, false if check for the same field already exists.
void OpenAB::PIMContactItemIndex::clearAllChecks ( )
static

Removes all defined PIMItemCheck for PIMContactItem.

bool OpenAB::PIMContactItemIndex::compare ( const PIMItemIndex other) const
virtual

Compares two PIMItemIndex object, checks if two PIMItemIndex are exactly the same. In opposite to compare operator it checks PIMItemCheck::eConflict fields.

Note
PIMItemCheck::eKey fields are not checked by this function, assumption is made that items were compared using operator ==() before, and only matching items are tested using this function.
Parameters
[in]otherinstance of PIMItemIndex to be compared with.
Returns
true if all PIMItemCheck::eConflict fields are the same in both PIMItemIndex objects, false otherwise.

Implements OpenAB::PIMItemIndex.

bool OpenAB::PIMContactItemIndex::compare ( const PIMContactItemIndex other) const

Compares two PIMContactItemIndex object, in opposite to compare operator it checks also PIMItemCheck::eConflict fields. Checks if two PIMContactItemIndex are exactly the same.

Parameters
[in]otherinstance of PIMContactItemIndex to be compared with.
Returns
true if all PIMItemCheck::eKey and PIMItemCheck::eConflict fields are the same in both PIMContactItemIndex objects, false otherwise.
bool OpenAB::PIMContactItemIndex::disableCheck ( const std::string &  fieldName)
static

Disables PIMItemCheck for PIMContactItem objects.

Note
Used for synchronization phases of OpenAB_Sync::Sync - when synchronization phase is ignoring some vCard fields from OpenAB_Source::Source, this allows to temporary disable checks for fields that are ignored, preventing from unwanted detection of not matching contacts from OpenAB_Storage::Storage.
Parameters
[in]fieldNamename of vCard field for which check should be disabled
Returns
true if check was disabled, false if check for given field does not exits.
void OpenAB::PIMContactItemIndex::enableAllChecks ( )
static

Enables all PIMItemCheck for PIMContactItem objects.

Note
for purpose enabling/disabling PIMItemCheck see disableCheck()
bool OpenAB::PIMContactItemIndex::enableCheck ( const std::string &  fieldName)
static

Enables PIMItemCheck for PIMContactItem objects.

Note
for purpose enabling/disabling PIMItemCheck see disableCheck()
Parameters
[in]fieldNamename of vCard field for which check should be enabled
Returns
true if check was enabled, false if check for given field does not exits.
std::vector< PIMItemIndex::PIMItemCheck > OpenAB::PIMContactItemIndex::getAllChecks ( )
static

Returns all defined PIMItemCheck for PIMContactItem objects.

Returns
all defined PIMItemCheck for PIMContactItem objects.
bool OpenAB::PIMContactItemIndex::operator!= ( const PIMItemIndex other) const
virtual

Compare operator. Checks if two PIMItemIndex not matches (are totally different)

Parameters
[in]otherinstance of PIMItemIndex to be compared with.
Returns
true if other PIMItemIndex is not of OpenAB::eContact or any PIMItemCheck::eKey fields is different in both PIMItemIndex objects, false otherwise.

Implements OpenAB::PIMItemIndex.

bool OpenAB::PIMContactItemIndex::operator!= ( const PIMContactItemIndex other) const

Compare operator. Checks if two PIMItemIndex not matches (are totally different)

Parameters
[in]otherinstance of PIMItemIndex to be compared with.
Returns
true if any PIMItemCheck::eKey fields is different in both PIMItemIndex objects, false otherwise.
bool OpenAB::PIMContactItemIndex::operator< ( const PIMItemIndex other) const
virtual

Compare operator.

Parameters
[in]otherinstance of PIMItemIndex to be compared with.
Returns
true if other PIMItemIndex is of OpenAB::eContact type and if index should be sorted before other index, according to theirs PIMItemCheck::eKey fields alphabetic order.
Note
Required to be able to store PIMItemIndex objects in std::map containers.

Implements OpenAB::PIMItemIndex.

bool OpenAB::PIMContactItemIndex::operator< ( const PIMContactItemIndex other) const

Compare operator.

Parameters
[in]otherinstance of PIMContactItemIndex to be compared with.
Returns
true if index should be sorted before other index, according to theirs PIMItemCheck::eKey fields alphabetic order.
Note
Required to be able store PIMContactItemIndex objects in std::map containers.
bool OpenAB::PIMContactItemIndex::operator== ( const PIMItemIndex other) const
virtual

Compare operator. Checks if two PIMItemIndex matches (may not be exactly the same)

Parameters
[in]otherinstance of PIMItemIndex to be compared with.
Returns
true if other PIMItemIndex is of OpenAB::eContact type and all PIMItemCheck::eKey fields are the same in both PIMItemIndex objects, false otherwise.

Implements OpenAB::PIMItemIndex.

bool OpenAB::PIMContactItemIndex::operator== ( const PIMContactItemIndex other) const

Compare operator. Checks if two PIMItemIndex matches (may not be exactly the same)

Parameters
[in]otherinstance of PIMItemIndex to be compared with.
Returns
true if all PIMItemCheck::eKey fields are the same in both PIMItemIndex objects, false otherwise.
bool OpenAB::PIMContactItemIndex::removeCheck ( const std::string &  fieldName)
static

Removes check for PIMContactItem objects.

Parameters
[in]fieldNamename of vCard field
Returns
true if check was removed, false if it does not exist.
std::string OpenAB::PIMContactItemIndex::toString ( ) const
virtual

Returns string version of PIMItemIndex. It contains only PIMItemCheck::eKey fields.

Returns
string version of PIMItemIndex

Implements OpenAB::PIMItemIndex.

std::string OpenAB::PIMContactItemIndex::toStringFull ( ) const
virtual

Returns string version of PIMItemIndex. It contains both PIMItemCheck::eKey and PIMItemCheck::eConflict fields.

Returns
string version of PIMItemIndex

Implements OpenAB::PIMItemIndex.


The documentation for this class was generated from the following files: