summaryrefslogtreecommitdiff
path: root/src/mime-printheader.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mime-printheader.cc')
-rw-r--r--src/mime-printheader.cc31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/mime-printheader.cc b/src/mime-printheader.cc
index 9fb168e..34f1b99 100644
--- a/src/mime-printheader.cc
+++ b/src/mime-printheader.cc
@@ -1,9 +1,10 @@
-/** --------------------------------------------------------------------
+/**
* @file mime-printheader.cc
* @brief Implementation of main mime parser components
* @author Andreas Aardal Hanssen
* @date 2002-2005
- * ----------------------------------------------------------------- **/
+ */
+
#include "convert.h"
#include "iodevice.h"
#include "iofactory.h"
@@ -22,9 +23,9 @@
#include <stdio.h>
#include <string.h>
-using namespace ::std;
+using std::string;
+using std::vector;
-//------------------------------------------------------------------------
void Binc::MimePart::printHeader(int fd,
IODevice &output,
vector<string> headers,
@@ -116,8 +117,7 @@ void Binc::MimePart::printHeader(int fd,
trim(lowername, ": \t");
bool foundMatch = false;
- for (vector<string>::const_iterator i = headers.begin(); i != headers.end(); ++i) {
- string nametmp = *i;
+ for (auto nametmp : headers) {
lowercase(nametmp);
if (nametmp == lowername) {
foundMatch = true;
@@ -127,14 +127,16 @@ void Binc::MimePart::printHeader(int fd,
if (foundMatch == includeheaders || headers.size() == 0) {
string out = name + content;
- for (string::const_iterator i = out.begin(); i != out.end(); ++i)
+ for (char i : out) {
if (processedbytes >= startoffset && wrotebytes < length) {
if (processedbytes >= startoffset) {
- store += *i;
+ store += i;
++wrotebytes;
}
- } else
+ } else {
++processedbytes;
+ }
+ }
}
// move on to the next header
@@ -151,8 +153,7 @@ void Binc::MimePart::printHeader(int fd,
lowercase(lowername);
trim(lowername, ": \t");
bool foundMatch = false;
- for (vector<string>::const_iterator i = headers.begin(); i != headers.end(); ++i) {
- string nametmp = *i;
+ for (auto nametmp : headers) {
lowercase(nametmp);
if (nametmp == lowername) {
foundMatch = true;
@@ -162,12 +163,14 @@ void Binc::MimePart::printHeader(int fd,
if (hasHeaderSeparator || foundMatch == includeheaders || headers.size() == 0) {
string out = name + content;
- for (string::const_iterator i = out.begin(); i != out.end(); ++i)
+ for (char i : out) {
if (processedbytes >= startoffset && wrotebytes < length) {
- store += *i;
+ store += i;
++wrotebytes;
- } else
+ } else {
++processedbytes;
+ }
+ }
}
}
}