mimeImage.cpp 479 B

123456789101112131415161718192021222324252627282930
  1. #include <fstream>
  2. #include <boost/algorithm/string.hpp>
  3. #include "base64.h"
  4. #include "mimeImage.h"
  5. mimeImage::mimeImage()
  6. {
  7. }
  8. mimeImage::mimeImage(const std::string& name) :
  9. m_name(name)
  10. {
  11. }
  12. void mimeImage::appendData(const std::string& data)
  13. {
  14. if (data.empty())
  15. return;
  16. m_imageData.append(data);
  17. }
  18. const inputImage& mimeImage::decodeImageData()
  19. {
  20. boost::erase_all(m_imageData, "\r");
  21. m_inputImage.setImageData(base64_decode(m_imageData));
  22. return m_inputImage;
  23. }