Hello I'm here again for help.
Is anyone able to tell me quite specifically what this code does??
Any help is appreciated!!
Code:
void printMimeStructure(MimeEntity* pMe, int tabcount = 0)
{
Header& h = pMe->header();
for(int c = tabcount; c > 0; --c)
cout << " ";
cout << h.from() << endl;
MimeEntityList& parts = pMe->body().parts();
// cycle on sub entities list and print info of every item
MimeEntityList::iterator mbit = parts.begin(), meit = parts.end();
for(; mbit != meit; ++mbit)
printMimeStructure(*mbit, 1 + tabcount);
}
I think that it parses a mail file and print the FROM, am I right??
Cause I'm trying to pass to this function a file, that I open in main(), using this:
Code:
//my posted code
ifstream is;
is.open ("text.txt", ios::in );
is.seekg (0, ios::end);
len= is.tellg();
is.seekg (0, ios::beg);
buff= new char [len];
is.read (buff,len);
istreambuf_iterator<char> test1(is), test2;
int VarTest = imTestP | imTestE;
MimeEntity me(test1, test2, VarTest );
printMimeStructure(&me);
But it doesn't parse anything!
In fact instead of printing the From field it prints '/'.
Something wrong in my posted code??