Boost logo

Boost Users :

From: Matthew Delves (webmattd_at_[hidden])
Date: 2004-02-17 23:52:07


Greetings,
Have been experimenting with the tokenizer class('s) in Boost and have
come to a bit of an impass.
What I am attempting to do is write an email client. Communication is
okay, though what I am stuck on is breaking apart the header of the
email into meaningful information. As according to RFC822 each header
field is sepperated by \r\n (CRLF) I want to use this as a deliminator
for the email message.
Unfortunantly each field in the header can be spread over multiple lines
~ and thereby when I use \r\n as a deliminator with boost it will
seperate strings if their is a \r or a \n. This is not what I want to
happen.
What I would like to do is sepperate on \r\n and only on that string and
if there is a "\n " (\n then a space) ignore it (or preferably get rid
of the \n and join the two strings).

The code that I am using to create the tokenizer is as follows.
boost::char_separator<char> deliminator(crlf, "", boost::drop_empty_tokens);
boost::tokenizer<boost::char_separator<char> > tokenizer(recieved,
deliminator);

If anyone has any suggestions it would be of great help.
Thanks,
Matthew Delves
http://www.webmastermattd.net
(Please send replies directly to me and not to the list... thanks)




Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net