From 9a73bbc894547abeb69c03101431204623c090e1 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Mon, 25 Sep 2017 17:24:50 +0200 Subject: [PATCH] Handle content disposition and add helper to set the content type in a content. --- src/content/content.cpp | 16 ++++++++++++++++ src/content/content.h | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/src/content/content.cpp b/src/content/content.cpp index 8a4aa7eef..c2b1a425a 100644 --- a/src/content/content.cpp +++ b/src/content/content.cpp @@ -31,6 +31,7 @@ class ContentPrivate : public ClonableObjectPrivate { public: vector body; ContentType contentType; + string contentDisposition; }; // ----------------------------------------------------------------------------- @@ -76,6 +77,21 @@ void Content::setContentType (const ContentType &contentType) { d->contentType = contentType; } +void Content::setContentType (const string &contentType) { + L_D(Content); + d->contentType = ContentType(contentType); +} + +const string &Content::getContentDisposition () const { + L_D(const Content); + return d->contentDisposition; +} + +void Content::setContentDisposition (const string &contentDisposition) { + L_D(Content); + d->contentDisposition = contentDisposition; +} + const std::vector &Content::getBody () const { L_D(const Content); return d->body; diff --git a/src/content/content.h b/src/content/content.h index 27c177711..7037b124a 100644 --- a/src/content/content.h +++ b/src/content/content.h @@ -43,6 +43,10 @@ public: const ContentType &getContentType () const; void setContentType (const ContentType &contentType); + void setContentType (const std::string &contentType); + + const std::string &getContentDisposition () const; + void setContentDisposition (const std::string &contentDisposition); const std::vector &getBody () const; std::string getBodyAsString () const;