diff options
Diffstat (limited to 'src/mime-getpart.cc')
-rw-r--r-- | src/mime-getpart.cc | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/src/mime-getpart.cc b/src/mime-getpart.cc index 7ce84fd..02a1ec5 100644 --- a/src/mime-getpart.cc +++ b/src/mime-getpart.cc @@ -4,27 +4,28 @@ * @author Andreas Aardal Hanssen * @date 2002-2005 * ----------------------------------------------------------------- **/ -#include "mime.h" #include "convert.h" -#include <string> -#include <vector> -#include <map> +#include "mime.h" + #include <exception> #include <iostream> +#include <map> +#include <string> +#include <vector> -#include <string.h> #include <ctype.h> -#include <stdio.h> #include <errno.h> +#include <stdio.h> +#include <string.h> using namespace ::std; //------------------------------------------------------------------------ const Binc::MimePart *Binc::MimePart::getPart(const string &findpart, - string genpart, FetchType fetchType) const + string genpart, + FetchType fetchType) const { - if (findpart == genpart) - return this; + if (findpart == genpart) return this; if (isMultipart()) { if (members.size() != 0) { @@ -33,14 +34,12 @@ const Binc::MimePart *Binc::MimePart::getPart(const string &findpart, while (i != members.end()) { BincStream ss; ss << genpart; - if (genpart != "") - ss << "."; + if (genpart != "") ss << "."; ss << part; const MimePart *m; if ((m = (*i).getPart(findpart, ss.str())) != 0) { - if (fetchType == FetchHeader && m->isMessageRFC822()) - m = &m->members[0]; + if (fetchType == FetchHeader && m->isMessageRFC822()) m = &m->members[0]; return m; } @@ -57,12 +56,10 @@ const Binc::MimePart *Binc::MimePart::getPart(const string &findpart, } } else { // Singlepart - if (genpart != "") - genpart += "."; + if (genpart != "") genpart += "."; genpart += "1"; - if (findpart == genpart) - return this; + if (findpart == genpart) return this; } return 0; |