20 #ifndef BLOB_H_E1B6D2C3
21 #define BLOB_H_E1B6D2C3
33 BlobImpl(
const char* data,
size_t size,
const std::string& mimeType,
bool adopt =
false);
36 std::string base64()
const;
37 std::string md5()
const;
38 static BlobImpl* fromBase64(
const std::string base64,
const std::string& mimeType);
40 char* getData()
const {
44 size_t getSize()
const {
48 std::string getMimeType()
const {
52 void setMimeType(
const std::string& mimeType) {
53 this->mimeType = mimeType;
70 Blob(
size_t size) : _impl(std::shared_ptr<BlobImpl>(
new BlobImpl(size))) {}
71 Blob(
const char* data,
73 const std::string& mimeType =
"application/octet-stream",
75 _impl(std::shared_ptr<BlobImpl>(
new BlobImpl(data, size, mimeType, adopt))) {}
77 static Blob fromBase64(
const std::string base64,
const std::string& mimeType =
"application/octet-stream") {
78 return Blob(std::shared_ptr<BlobImpl>(BlobImpl::fromBase64(base64, mimeType)));
81 std::string base64()
const {
82 return _impl->base64();
85 std::string md5()
const {
89 char* getData()
const {
90 return _impl->getData();
93 size_t getSize()
const {
94 return _impl->getSize();
97 std::string getMimeType()
const {
98 return _impl->getMimeType();
101 void setMimeType(
const std::string& mimeType) {
102 _impl->setMimeType(mimeType);
108 std::shared_ptr<BlobImpl> _impl;
Definition: Breakpoint.cpp:26
#define PIMPL_OPERATORS(type)
The usual operators as required for the PIMPL pattern.
Definition: Common.h:68