int errorCode = 0;
contacts_filter_h filter = NULL;
+ if(matchValue == NULL || matchValue->isNullOrUndefined())
+ matchFlag = MATCH_EXISTS;
+
if(depth != 0)
{
filter = m_filterStack.top();
int value = 0;
if(attrName == "id" || attrName == "displayContactId")
{
- string valueStr = matchValue->getString();
- value = ContactUtility::strToInt(valueStr);
+ if(matchFlag != MATCH_EXISTS){
+ string valueStr = matchValue->getString();
+ value = ContactUtility::strToInt(valueStr);
+ }
+ }
+ else{
+ if(matchFlag != MATCH_EXISTS)
+ value = matchValue->getLong();
}
- else
- value = matchValue->getLong();
contacts_match_int_flag_e flag;
if(matchFlag == MATCH_EXISTS)
else if(property.type == PrimitiveType_String)
{
string value;
- if(attrName == "photoURI" || attrName == "ringtoneURI")
- value = ContactUtility::convertUriToPath(matchValue->getString());
- else
- value = matchValue->getString();
+ if(matchFlag != MATCH_EXISTS){
+ if(attrName == "photoURI" || attrName == "ringtoneURI")
+ value = ContactUtility::convertUriToPath(matchValue->getString());
+ else
+ value = matchValue->getString();
+ }else
+ value = "";
contacts_match_str_flag_e flag = CONTACTS_MATCH_EXISTS;
if(matchFlag == MATCH_EXACTLY)
}
else if(property.type == PrimitiveType_Boolean)
{
- bool value = false;
- value = matchValue->getBool();
-
- // TODO MATCH_EXISTS
-// if(matchFlag == MATCH_EXISTS)
-// else
+ bool value = true;
+ if(matchFlag != MATCH_EXISTS)
+ value = matchValue->getBool();
errorCode = contacts_filter_add_bool(filter, property.propertyId, value);
}