Handle content disposition and add helper to set the content type in a content.

This commit is contained in:
Ghislain MARY 2017-09-25 17:24:50 +02:00
parent 27f2dff83f
commit 9a73bbc894
2 changed files with 20 additions and 0 deletions

View file

@ -31,6 +31,7 @@ class ContentPrivate : public ClonableObjectPrivate {
public:
vector<char> 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<char> &Content::getBody () const {
L_D(const Content);
return d->body;

View file

@ -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<char> &getBody () const;
std::string getBodyAsString () const;