Hi all,
I have a problem with the PcmsQuery function. I want to search in a product for a file.
For example: TEST.txt
When the product contains TEST.txt, PCMS_QUERY return PCMS_OK but when the filename in another product contains a lowercase characters like Test.txt. So the PcmsQuery function returns PCMS_FAIL.
Is it possible to use PcmsQuery function with valueCase.
I saw that there is PcmsObjAttrDefStruct but PcmsAttrDefInit returns each time PCMS_FAIL.
You find as below my code :
itemObj.objType = PCMS_ITEM;
itemObj.noAttrs = 2;
itemObj.attrs = (PcmsObjAttrStruct*)PcmsEvntCalloc(sizeof(PcmsObjAttrStruct) * itemObj.noAttrs);
number_of_attr = 1;
SET_ATTR(PCMS_ATTR_PRODUCT_ID, itemObj, product, number_of_attr);
SET_ATTR(PCMS_ATTR_FILENAME, itemObj, fileName, number_of_attr);
if (PcmsAttrDefInit(connectionID, itemObj.typeUid, itemObj.objType, 2, &attrDef) != PCMS_OK)
return PCMS_FAIL;
attrDef->valueCase = 'M';
itemObj.attrs[1].attrDef = attrDef;
apiResult = PcmsQuery(connectionID, &itemObj, PCMS_OPT_LATEST, &uids_item_number, &uids_item);
if (apiResult == PCMS_OK && uids_item_number)
return PCMS_OK
else
return PCMS_FAIL