Better cut what you need with regex from mime multipart data faster. And don't need learn new libs. There is simple php parser https://github.com/breakermind/PhpMimeParser/blob/master/PhpMimeParser_class.php but with regex you can write it in c++ very simple. Only 357 lines.