31 lines
479 B
C++
31 lines
479 B
C++
#include <fstream>
|
|
#include <boost/algorithm/string.hpp>
|
|
#include "base64.h"
|
|
#include "mimeImage.h"
|
|
|
|
|
|
mimeImage::mimeImage()
|
|
{
|
|
}
|
|
|
|
mimeImage::mimeImage(const std::string& name) :
|
|
m_name(name)
|
|
{
|
|
}
|
|
|
|
void mimeImage::appendData(const std::string& data)
|
|
{
|
|
if (data.empty())
|
|
return;
|
|
|
|
m_imageData.append(data);
|
|
}
|
|
|
|
const inputImage& mimeImage::decodeImageData()
|
|
{
|
|
boost::erase_all(m_imageData, "\r");
|
|
m_inputImage.setImageData(base64_decode(m_imageData));
|
|
return m_inputImage;
|
|
}
|
|
|