99#ifndef _BOOST_MIME_HPP
1010#define _BOOST_MIME_HPP
1111
12+ #include < iosfwd>
1213#include < list>
1314#include < string>
1415#include < vector>
15- #include < iosfwd>
1616
17- #include < boost/spirit/include/qi .hpp>
17+ #include < boost/fusion/adapted/struct .hpp>
1818#include < boost/fusion/include/std_pair.hpp>
1919#include < boost/spirit/include/phoenix.hpp> // pulls in all of Phoenix
20+ #include < boost/spirit/include/qi.hpp>
2021#include < boost/spirit/include/support_istream_iterator.hpp>
21- #include < boost/fusion/adapted/struct.hpp>
2222
23- #include < boost/shared_ptr.hpp>
24- #include < boost/format.hpp>
25- #include < boost/algorithm/string/predicate.hpp>
2623#include < boost/algorithm/string.hpp>
24+ #include < boost/algorithm/string/predicate.hpp>
25+ #include < boost/format.hpp>
26+ #include < boost/shared_ptr.hpp>
2727
2828// #defineDUMP_MIME_DATA1
2929
@@ -321,7 +321,8 @@ static void read_multipart_body(Iterator &begin, Iterator end,
321321" = %d %s" ) %
322322 mp_body.body_prolog .size () % mp_body.sub_parts .size () %
323323 mp_body.body_epilog .size () %
324- (mp_body.prolog_is_missing ?" (missing)" :" " )) << std::endl;
324+ (mp_body.prolog_is_missing ?" (missing)" :" " ))
325+ << std::endl;
325326 std::cout << std::endl <<" ****** Multipart Body Prolog *******" << std::endl;
326327std::copy (mp_body.body_prolog .begin (), mp_body.body_prolog .end (),
327328 std::ostream_iterator<char >(std::cout));
@@ -381,11 +382,7 @@ static boost::shared_ptr<basic_mime<traits> > parse_mime(
381382template <class traits = detail::default_types>
382383class basic_mime {
383384public:
384- typedef enum {
385- simple_part,
386- multi_part,
387- message_part
388- } part_kind;
385+ typedef enum { simple_part, multi_part, message_part } part_kind;
389386// Types for headers
390387typedef typename traits::string_type string_type;
391388typedef std::pair<std::string, string_type> headerEntry;
@@ -618,8 +615,7 @@ class basic_mime {
618615 std::string boundary;
619616try {
620617 boundary =detail::get_boundary (get_content_type_header ());
621- }
622- catch (std::runtime_error &) {
618+ }catch (std::runtime_error &) {
623619// FIXME: Make boundary strings (more?) unique
624620 boundary =str (boost::format (" ------=_NextPart-%s.%08ld" ) %
625621 detail::k_package_name %std::clock ());
@@ -707,9 +703,8 @@ class basic_mime {
707703else if (get_part_kind () == multi_part) {
708704if (idx >= m_subparts.size ())
709705throw std::runtime_error (
710- str (boost::format (
711- " Trying to access part %d (of %d) sub-part to a"
712- " multipart/xxx mime part" ) %
706+ str (boost::format (" Trying to access part %d (of %d) sub-part to a"
707+ " multipart/xxx mime part" ) %
713708 idx % m_subparts.size ()));
714709 }else {// message-part
715710if (get_part_kind () == message_part)
@@ -720,9 +715,8 @@ class basic_mime {
720715
721716if (idx >= m_subparts.size ())
722717throw std::runtime_error (
723- str (boost::format (
724- " Trying to access part %d (of %d) sub-part to a"
725- " message/xxx mime part" ) %
718+ str (boost::format (" Trying to access part %d (of %d) sub-part to a"
719+ " message/xxx mime part" ) %
726720 idx % m_subparts.size ()));
727721 }
728722 }
@@ -764,12 +758,14 @@ static boost::shared_ptr<basic_mime<traits> > parse_mime(
764758#ifdef DUMP_MIME_DATA
765759 std::cout <<" Content-Type:" << content_type << std::endl;
766760 std::cout <<str (boost::format (" retVal->get_part_kind () = %d" ) %
767- ((int )retVal->get_part_kind ())) << std::endl;
761+ ((int )retVal->get_part_kind ()))
762+ << std::endl;
768763#endif
769764
770765if (retVal->get_part_kind () == mime_part::simple_part)
771- retVal->set_body (detail::read_simplepart_body<
772- typename mime_part::bodyContainer, Iterator>(begin, end));
766+ retVal->set_body (
767+ detail::read_simplepart_body<typename mime_part::bodyContainer,
768+ Iterator>(begin, end));
773769else if (retVal->get_part_kind () == mime_part::message_part) {
774770// If we've got a message/xxxx, then there is no body, and we have
775771// a single