diff options
Diffstat (limited to 'src/mime-printheader.cc')
-rw-r--r-- | src/mime-printheader.cc | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/src/mime-printheader.cc b/src/mime-printheader.cc index 84dca1e..9fb168e 100644 --- a/src/mime-printheader.cc +++ b/src/mime-printheader.cc @@ -4,31 +4,34 @@ * @author Andreas Aardal Hanssen * @date 2002-2005 * ----------------------------------------------------------------- **/ -#include "mime.h" -#include "mime-utils.h" -#include "mime-inputsource.h" #include "convert.h" #include "iodevice.h" #include "iofactory.h" +#include "mime-inputsource.h" +#include "mime-utils.h" +#include "mime.h" -#include <string> -#include <vector> -#include <map> #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; //------------------------------------------------------------------------ -void Binc::MimePart::printHeader(int fd, IODevice &output, - vector<string> headers, bool includeheaders, +void Binc::MimePart::printHeader(int fd, + IODevice &output, + vector<string> headers, + bool includeheaders, unsigned int startoffset, - unsigned int length, string &store) const + unsigned int length, + string &store) const { if (!mimeSource || mimeSource->getFileDescriptor() != fd) { delete mimeSource; @@ -66,11 +69,11 @@ void Binc::MimePart::printHeader(int fd, IODevice &output, // break if a '\n' turned up. if (c == '\n') { - // end of headers detected + // end of headers detected if (name == "\r\n") { - hasHeaderSeparator = true; - quit = true; - break; + hasHeaderSeparator = true; + quit = true; + break; } // put all data back in the buffer to the beginning of this @@ -113,13 +116,12 @@ void Binc::MimePart::printHeader(int fd, IODevice &output, trim(lowername, ": \t"); bool foundMatch = false; - for (vector<string>::const_iterator i = headers.begin(); - i != headers.end(); ++i) { + for (vector<string>::const_iterator i = headers.begin(); i != headers.end(); ++i) { string nametmp = *i; lowercase(nametmp); if (nametmp == lowername) { foundMatch = true; - break; + break; } } @@ -149,8 +151,7 @@ void Binc::MimePart::printHeader(int fd, IODevice &output, lowercase(lowername); trim(lowername, ": \t"); bool foundMatch = false; - for (vector<string>::const_iterator i = headers.begin(); - i != headers.end(); ++i) { + for (vector<string>::const_iterator i = headers.begin(); i != headers.end(); ++i) { string nametmp = *i; lowercase(nametmp); if (nametmp == lowername) { @@ -158,7 +159,7 @@ void Binc::MimePart::printHeader(int fd, IODevice &output, break; } } - + if (hasHeaderSeparator || foundMatch == includeheaders || headers.size() == 0) { string out = name + content; for (string::const_iterator i = out.begin(); i != out.end(); ++i) |