diff options
Diffstat (limited to 'Swiften/Elements/VCard.h')
| -rw-r--r-- | Swiften/Elements/VCard.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Swiften/Elements/VCard.h b/Swiften/Elements/VCard.h index 84b6cfe..409a8ab 100644 --- a/Swiften/Elements/VCard.h +++ b/Swiften/Elements/VCard.h @@ -231,61 +231,71 @@ namespace Swift { return titles_; } void addTitle(const std::string& title) { titles_.push_back(title); } void clearTitles() { titles_.clear(); } const std::vector<std::string>& getRoles() const { return roles_; } void addRole(const std::string& role) { roles_.push_back(role); } void clearRoles() { roles_.clear(); } const std::vector<std::string>& getURLs() const { return urls_; } void addURL(const std::string& url) { urls_.push_back(url); } void clearURLs() { urls_.clear(); } + bool isEmpty() const { + bool empty = version_.empty() && fullName_.empty() && familyName_.empty() && givenName_.empty() && middleName_.empty() && prefix_.empty() && suffix_.empty(); + empty &= photo_.empty() && photoType_.empty() && nick_.empty(); + empty &= birthday_.is_not_a_date_time(); + empty &= unknownContent_.empty(); + empty &= emailAddresses_.empty() && telephones_.empty() && addresses_.empty() && addressLabels_.empty() && jids_.empty(); + empty &= description_.empty() && organizations_.empty() && titles_.empty() && roles_.empty() && urls_.empty(); + return empty; + } + private: std::string version_; std::string fullName_; std::string familyName_; std::string givenName_; std::string middleName_; std::string prefix_; std::string suffix_; //std::string email_; ByteArray photo_; std::string photoType_; std::string nick_; boost::posix_time::ptime birthday_; std::string unknownContent_; std::vector<EMailAddress> emailAddresses_; std::vector<Telephone> telephones_; std::vector<Address> addresses_; std::vector<AddressLabel> addressLabels_; std::vector<JID> jids_; std::string description_; std::vector<Organization> organizations_; std::vector<std::string> titles_; std::vector<std::string> roles_; std::vector<std::string> urls_; }; } |
Swift