0

I'm using libcurl to fetch e-mail with IMAP. Fetching itself is successful, but the problem is that libcurl can save the result of communication only in std::string or FILE* (as far as I have searched).

This made it difficult for me to parse the result into header, mime, and so on.

So I have searched libraries which makes parsing easier, but those are for other languages not for C/C++.

Since my project only uses C/C++, I have to use only those languages. VMime is written in C/C++ but I couldn't use Vmime because it uses its own implementation on IMAP communication (which makes libcurl useless).

// code to save the IMAP communication result into std::string buffer

curl_easy_setopt(mCurl, CURLOPT_WRITEFUNCTION, callback);
curl_easy_setopt(mCurl, CURLOPT_WRITEDATA, &readBuffer);

readBuffer is std::string. I want to parse the result in readBuffer into desirable data structure( ex)stl ) for easier access.

Are there good libraries for it? I have searched for a day but I couldn't find it. Or if I can use Vmime only to parse the result, not affecting other libcurl codes that I have already finished, can you guide me how to do it?

I appreciate it in advance.

Garam Choi
  • 129
  • 1
  • 2
  • 10

0 Answers0