vcard.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __BARRY_SYNC_VCARD_H__
00023 #define __BARRY_SYNC_VCARD_H__
00024
00025 #include "vbase.h"
00026 #include "r_contact.h"
00027 #include <stdint.h>
00028 #include <string>
00029
00030 namespace Barry { namespace Sync {
00031
00032
00033
00034
00035
00036
00037
00038 class vCard : public vBase
00039 {
00040
00041 char *m_gCardData;
00042
00043
00044 std::string m_vCardData;
00045 Barry::Contact m_BarryContact;
00046
00047 protected:
00048 void AddAddress(const char *rfc_type, const Barry::PostalAddress &addr);
00049 void AddCategories(const Barry::CategoryList &categories);
00050 void AddPhoneCond(const std::string &phone);
00051 void AddPhoneCond(const char *rfc_type, const std::string &phone);
00052
00053 void ParseAddress(vAttr &adr, Barry::PostalAddress &address);
00054 void ParseCategories(vAttr &cat, Barry::CategoryList &cats);
00055
00056 public:
00057 vCard();
00058 ~vCard();
00059
00060 const std::string& ToVCard(const Barry::Contact &con);
00061 const Barry::Contact& ToBarry(const char *vcal, uint32_t RecordId);
00062
00063 const std::string& GetVCard() const { return m_vCardData; }
00064 const Barry::Contact& GetBarryContact() const { return m_BarryContact; }
00065
00066 char* ExtractVCard();
00067
00068 void Clear();
00069 };
00070
00071 }}
00072
00073 #endif
00074