From 3544ad224f37e559df2668f0c2bac3846d4f913c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 2 Oct 2017 10:41:20 +0200 Subject: [PATCH] feat(Content): add `isEmpty` method --- src/content/content.cpp | 4 ++++ src/content/content.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/content/content.cpp b/src/content/content.cpp index 23b56f3cb..0557e3955 100644 --- a/src/content/content.cpp +++ b/src/content/content.cpp @@ -128,4 +128,8 @@ size_t Content::getSize () const { return d->body.size(); } +bool Content::isEmpty () const { + return getSize() == 0; +} + LINPHONE_END_NAMESPACE diff --git a/src/content/content.h b/src/content/content.h index 62b5cbe20..b68e7a344 100644 --- a/src/content/content.h +++ b/src/content/content.h @@ -48,12 +48,16 @@ public: const std::vector &getBody () const; std::string getBodyAsString () const; + void setBody (const std::vector &body); void setBody (const std::vector &&body); void setBody (const std::string &body); void setBody (const void *buffer, size_t size); + size_t getSize () const; + bool isEmpty () const; + private: L_DECLARE_PRIVATE(Content); };