Commit b9e1951b authored by Ronan's avatar Ronan
Browse files

feat(belcard): use override when possible

parent f8a21771
......@@ -45,7 +45,7 @@ namespace belcard {
private:
std::string _folded_string;
bool _skipFieldValidation = false;
std::shared_ptr<BelCardKind> _kind;
std::shared_ptr<BelCardFullName> _fn;
std::shared_ptr<BelCardName> _n;
......@@ -86,16 +86,16 @@ namespace belcard {
std::list<std::shared_ptr<BelCardCALURI>> _caluris;
std::list<std::shared_ptr<BelCardProperty>> _extended_properties;
std::list<std::shared_ptr<BelCardProperty>> _properties;
template<typename T>
void set(std::shared_ptr<T> &p, const std::shared_ptr<T> &property);
template<typename T>
void add(std::list<std::shared_ptr<T>> &property_list, const std::shared_ptr<T> &property);
template<typename T>
void remove(std::list<std::shared_ptr<T>> &property_list, const std::shared_ptr<T> &property);
// The following are for belcard use only, they don't do any check on the value
void _setKind(const std::shared_ptr<BelCardKind> &kind);
void _setFullName(const std::shared_ptr<BelCardFullName> &fn);
......@@ -136,181 +136,181 @@ namespace belcard {
void _addCALADRURI(const std::shared_ptr<BelCardCALADRURI> &caladruri);
void _addCALURI(const std::shared_ptr<BelCardCALURI> &caluri);
void _addExtendedProperty(const std::shared_ptr<BelCardProperty> &property);
public:
BELCARD_PUBLIC static void setHandlerAndCollectors(belr::Parser<std::shared_ptr<BelCardGeneric>> *parser);
BELCARD_PUBLIC BelCard();
BELCARD_PUBLIC void setSkipFieldValidation(bool skip);
BELCARD_PUBLIC bool getSkipFieldValidation();
BELCARD_PUBLIC bool setKind(const std::shared_ptr<BelCardKind> &kind);
BELCARD_PUBLIC const std::shared_ptr<BelCardKind> &getKind() const;
BELCARD_PUBLIC bool setFullName(const std::shared_ptr<BelCardFullName> &fn);
BELCARD_PUBLIC const std::shared_ptr<BelCardFullName> &getFullName() const;
BELCARD_PUBLIC bool setName(const std::shared_ptr<BelCardName> &n);
BELCARD_PUBLIC const std::shared_ptr<BelCardName> &getName() const;
BELCARD_PUBLIC bool setBirthday(const std::shared_ptr<BelCardBirthday> &bday);
BELCARD_PUBLIC const std::shared_ptr<BelCardBirthday> &getBirthday() const;
BELCARD_PUBLIC bool setAnniversary(const std::shared_ptr<BelCardAnniversary> &anniversary);
BELCARD_PUBLIC const std::shared_ptr<BelCardAnniversary> &getAnniversary() const;
BELCARD_PUBLIC bool setGender(const std::shared_ptr<BelCardGender> &gender);
BELCARD_PUBLIC const std::shared_ptr<BelCardGender> &getGender() const;
BELCARD_PUBLIC bool setProductId(const std::shared_ptr<BelCardProductId> &pid);
BELCARD_PUBLIC const std::shared_ptr<BelCardProductId> &getProductId() const;
BELCARD_PUBLIC bool setRevision(const std::shared_ptr<BelCardRevision> &rev);
BELCARD_PUBLIC const std::shared_ptr<BelCardRevision> &getRevision() const;
BELCARD_PUBLIC bool setUniqueId(const std::shared_ptr<BelCardUniqueId> &uid);
BELCARD_PUBLIC const std::shared_ptr<BelCardUniqueId> &getUniqueId() const;
BELCARD_PUBLIC bool setBirthPlace(const std::shared_ptr<BelCardBirthPlace> &place);
BELCARD_PUBLIC const std::shared_ptr<BelCardBirthPlace> &getBirthPlace() const;
BELCARD_PUBLIC bool setDeathPlace(const std::shared_ptr<BelCardDeathPlace> &place);
BELCARD_PUBLIC const std::shared_ptr<BelCardDeathPlace> &getDeathPlace() const;
BELCARD_PUBLIC bool setDeathDate(const std::shared_ptr<BelCardDeathDate> &date);
BELCARD_PUBLIC const std::shared_ptr<BelCardDeathDate> &getDeathDate() const;
BELCARD_PUBLIC bool addNickname(const std::shared_ptr<BelCardNickname> &nickname);
BELCARD_PUBLIC void removeNickname(const std::shared_ptr<BelCardNickname> &nickname);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardNickname>> &getNicknames() const;
BELCARD_PUBLIC bool addPhoto(const std::shared_ptr<BelCardPhoto> &photo);
BELCARD_PUBLIC void removePhoto(const std::shared_ptr<BelCardPhoto> &photo);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardPhoto>> &getPhotos() const;
BELCARD_PUBLIC bool addAddress(const std::shared_ptr<BelCardAddress> &addr);
BELCARD_PUBLIC void removeAddress(const std::shared_ptr<BelCardAddress> &addr);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardAddress>> &getAddresses() const;
BELCARD_PUBLIC bool addPhoneNumber(const std::shared_ptr<BelCardPhoneNumber> &tel);
BELCARD_PUBLIC void removePhoneNumber(const std::shared_ptr<BelCardPhoneNumber> &tel);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardPhoneNumber>> &getPhoneNumbers() const;
BELCARD_PUBLIC bool addEmail(const std::shared_ptr<BelCardEmail> &email);
BELCARD_PUBLIC void removeEmail(const std::shared_ptr<BelCardEmail> &email);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardEmail>> &getEmails() const;
BELCARD_PUBLIC bool addImpp(const std::shared_ptr<BelCardImpp> &impp);
BELCARD_PUBLIC void removeImpp(const std::shared_ptr<BelCardImpp> &impp);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardImpp>> &getImpp() const;
BELCARD_PUBLIC bool addLang(const std::shared_ptr<BelCardLang> &lang);
BELCARD_PUBLIC void removeLang(const std::shared_ptr<BelCardLang> &lang);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardLang>> &getLangs() const;
BELCARD_PUBLIC bool addSource(const std::shared_ptr<BelCardSource> &source);
BELCARD_PUBLIC void removeSource(const std::shared_ptr<BelCardSource> &source);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardSource>> &getSource() const;
BELCARD_PUBLIC bool addXML(const std::shared_ptr<BelCardXML> &xml);
BELCARD_PUBLIC void removeXML(const std::shared_ptr<BelCardXML> &xml);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardXML>> &getXML() const;
BELCARD_PUBLIC bool addTimezone(const std::shared_ptr<BelCardTimezone> &tz);
BELCARD_PUBLIC void removeTimezone(const std::shared_ptr<BelCardTimezone> &tz);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardTimezone>> &getTimezones() const;
BELCARD_PUBLIC bool addGeo(const std::shared_ptr<BelCardGeo> &geo);
BELCARD_PUBLIC void removeGeo(const std::shared_ptr<BelCardGeo> &geo);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardGeo>> &getGeos() const;
BELCARD_PUBLIC bool addTitle(const std::shared_ptr<BelCardTitle> &title);
BELCARD_PUBLIC void removeTitle(const std::shared_ptr<BelCardTitle> &title);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardTitle>> &getTitles() const;
BELCARD_PUBLIC bool addRole(const std::shared_ptr<BelCardRole> &role);
BELCARD_PUBLIC void removeRole(const std::shared_ptr<BelCardRole> &role);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardRole>> &getRoles() const;
BELCARD_PUBLIC bool addLogo(const std::shared_ptr<BelCardLogo> &logo);
BELCARD_PUBLIC void removeLogo(const std::shared_ptr<BelCardLogo> &logo);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardLogo>> &getLogos() const;
BELCARD_PUBLIC bool addOrganization(const std::shared_ptr<BelCardOrganization> &org);
BELCARD_PUBLIC void removeOrganization(const std::shared_ptr<BelCardOrganization> &org);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardOrganization>> &getOrganizations() const;
BELCARD_PUBLIC bool addMember(const std::shared_ptr<BelCardMember> &member);
BELCARD_PUBLIC void removeMember(const std::shared_ptr<BelCardMember> &member);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardMember>> &getMembers() const;
BELCARD_PUBLIC bool addRelated(const std::shared_ptr<BelCardRelated> &related);
BELCARD_PUBLIC void removeRelated(const std::shared_ptr<BelCardRelated> &related);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardRelated>> &getRelated() const;
BELCARD_PUBLIC bool addCategories(const std::shared_ptr<BelCardCategories> &categories);
BELCARD_PUBLIC void removeCategories(const std::shared_ptr<BelCardCategories> &categories);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardCategories>> &getCategories() const;
BELCARD_PUBLIC bool addNote(const std::shared_ptr<BelCardNote> &note);
BELCARD_PUBLIC void removeNote(const std::shared_ptr<BelCardNote> &note);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardNote>> &getNotes() const;
BELCARD_PUBLIC bool addSound(const std::shared_ptr<BelCardSound> &sound);
BELCARD_PUBLIC void removeSound(const std::shared_ptr<BelCardSound> &sound);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardSound>> &getSounds() const;
BELCARD_PUBLIC bool addClientProductIdMap(const std::shared_ptr<BelCardClientProductIdMap> &clientpidmap);
BELCARD_PUBLIC void removeClientProductIdMap(const std::shared_ptr<BelCardClientProductIdMap> &clientpidmap);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardClientProductIdMap>> &getClientProductIdMaps() const;
BELCARD_PUBLIC bool addURL(const std::shared_ptr<BelCardURL> &url);
BELCARD_PUBLIC void removeURL(const std::shared_ptr<BelCardURL> &url);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardURL>> &getURLs() const;
BELCARD_PUBLIC bool addKey(const std::shared_ptr<BelCardKey> &key);
BELCARD_PUBLIC void removeKey(const std::shared_ptr<BelCardKey> &key);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardKey>> &getKeys() const;
BELCARD_PUBLIC bool addFBURL(const std::shared_ptr<BelCardFBURL> &fburl);
BELCARD_PUBLIC void removeFBURL(const std::shared_ptr<BelCardFBURL> &fburl);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardFBURL>> &getFBURLs() const;
BELCARD_PUBLIC bool addCALADRURI(const std::shared_ptr<BelCardCALADRURI> &caladruri);
BELCARD_PUBLIC void removeCALADRURI(const std::shared_ptr<BelCardCALADRURI> &caladruri);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardCALADRURI>> &getCALADRURIs() const;
BELCARD_PUBLIC bool addCALURI(const std::shared_ptr<BelCardCALURI> &caluri);
BELCARD_PUBLIC void removeCALURI(const std::shared_ptr<BelCardCALURI> &caluri);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardCALURI>> &getCALURIs() const;
BELCARD_PUBLIC bool addExtendedProperty(const std::shared_ptr<BelCardProperty> &property);
BELCARD_PUBLIC void removeExtendedProperty(const std::shared_ptr<BelCardProperty> &property);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardProperty>> &getExtendedProperties() const;
BELCARD_PUBLIC void addProperty(const std::shared_ptr<BelCardProperty> &property);
BELCARD_PUBLIC void removeProperty(const std::shared_ptr<BelCardProperty> &property);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCardProperty>> &getProperties() const;
BELCARD_PUBLIC std::string& toFoldedString();
BELCARD_PUBLIC bool assertRFCCompliance() const;
BELCARD_PUBLIC virtual void serialize(std::ostream &output) const;
BELCARD_PUBLIC void serialize(std::ostream &output) const override;
};
class BelCardList : public BelCardGeneric {
private:
std::list<std::shared_ptr<BelCard>> _vCards;
public:
BELCARD_PUBLIC static void setHandlerAndCollectors(belr::Parser<std::shared_ptr<BelCardGeneric>> *parser);
BELCARD_PUBLIC BelCardList();
BELCARD_PUBLIC void addCard(const std::shared_ptr<BelCard> &vcard);
BELCARD_PUBLIC const std::list<std::shared_ptr<BelCard>> &getCards() const;
BELCARD_PUBLIC void serialize(std::ostream &output) const;
BELCARD_PUBLIC void serialize(std::ostream &output) const override;
};
}
......
......@@ -70,7 +70,7 @@ namespace belcard {
BELCARD_PUBLIC void setLabelParam(const std::shared_ptr<BelCardLabelParam> &param);
BELCARD_PUBLIC const std::shared_ptr<BelCardLabelParam> &getLabelParam() const;
BELCARD_PUBLIC virtual void serialize(std::ostream &output) const;
BELCARD_PUBLIC void serialize(std::ostream &output) const override;
};
}
......
......@@ -52,8 +52,8 @@ namespace belcard {
BELCARD_PUBLIC static std::shared_ptr<BelCardImpp> parse(const std::string& input);
BELCARD_PUBLIC static void setHandlerAndCollectors(belr::Parser<std::shared_ptr<BelCardGeneric>> *parser);
BELCARD_PUBLIC virtual void setValue(const std::string &value);
BELCARD_PUBLIC virtual void serialize(std::ostream &output) const;
BELCARD_PUBLIC void setValue(const std::string &value) override;
BELCARD_PUBLIC void serialize(std::ostream &output) const override;
BELCARD_PUBLIC BelCardImpp();
};
......
......@@ -67,7 +67,7 @@ namespace belcard {
BELCARD_PUBLIC void setSuffixes(const std::string &value);
BELCARD_PUBLIC const std::string &getSuffixes() const;
BELCARD_PUBLIC virtual void serialize(std::ostream &output) const;
BELCARD_PUBLIC void serialize(std::ostream &output) const override;
};
class BelCardNickname : public BelCardProperty {
......
......@@ -48,7 +48,7 @@ namespace belcard {
BELCARD_PUBLIC virtual void setValue(const std::string &value) ;
BELCARD_PUBLIC virtual const std::string &getValue() const;
BELCARD_PUBLIC virtual void serialize(std::ostream &output) const;
BELCARD_PUBLIC void serialize(std::ostream &output) const override;
};
class BelCardLanguageParam : public BelCardParam {
......
......@@ -114,7 +114,7 @@ namespace belcard {
BELCARD_PUBLIC virtual const std::list<std::shared_ptr<BelCardParam>> &getParams() const;
BELCARD_PUBLIC virtual void removeParam(const std::shared_ptr<BelCardParam> &param);
BELCARD_PUBLIC virtual void serialize(std::ostream &output) const;
BELCARD_PUBLIC void serialize(std::ostream &output) const override;
};
}
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment