Developer

API Reference

IvCard

Brew Release
Brew MP 1.0.2
See Also
None
Description

Interface to parse the buffer containing vCard objects. IvCard - Interface to vCard objects
The vCard definitions can be identified and parsed within the buffer. The vCard is intended to be used for exchanging information about people and resources. A vCard is a collection of one or more properties. A property is a uniquely named value. A set of properties can be grouped within a vCard. A set of parameters can be associated to a property. Parameter is again a name-value pair.
Usage

If we have simple vCard of vCard spec author, (this vCard is from rfc 2426)
   BEGIN:vCard
   VERSION:3.0
   FN:Frank Dawson
   ORG:Lotus Development Corporation
   EMAIL;TYPE=INTERNET,PREF:Frank_Dawson@Lotus.com
   EMAIL;TYPE=INTERNET:fdawson@earthlink.net
   URL:http://home.earthlink.net/~fdawson
   END:vCard

   void Sample_vCard_Usage1(IvCard *pIvCard)
   {
      int nResult = 0;
      IvProperty *pIvProperty = NULL;
      int nNumProps = 0;
      int nNumParms = 0;

      nResult = IvCard_GetNumberOfProperties(pIvCard,0,&nNumProps);
      //on return nNumProps=6

      nResult = IvCard_GetNumberOfProperties(pIvCard,AEEVPROPERTY_EMAIL,&nNumProps);
      //on return nNumProps=2;

      nResult = IvCard_GetPropertyAtIndex(pIvCard,AEEVPROPERTY_EMAIL,0,&pIvProperty);
      //pIvPropety would be pointg to the first EMAIL property in the above buffer

      nResult = IvProperty_GetNumberOfParms(pIvProperty,0,&nNumParms);
      //on return nNumParms=2

      RELEASEIF(pIvProperty);

   }
  • Follow