summaryrefslogtreecommitdiff
path: root/src/imapparser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/imapparser.cc')
-rw-r--r--src/imapparser.cc70
1 files changed, 32 insertions, 38 deletions
diff --git a/src/imapparser.cc b/src/imapparser.cc
index 2e7d746..fc2e071 100644
--- a/src/imapparser.cc
+++ b/src/imapparser.cc
@@ -2,32 +2,32 @@
* @file imapparser.cc
* @brief Implementation of the common items for parsing IMAP input
* @author Andreas Aardal Hanssen
- * @date 2002-2005
+ * @date 2002-2005
* ----------------------------------------------------------------- **/
#include "imapparser.h"
+
#include "convert.h"
-#include <stdio.h>
-#include <map>
+#include <exception>
#include <iostream>
-#include <vector>
+#include <map>
#include <string>
-#include <exception>
+#include <vector>
+
+#include <stdio.h>
using namespace ::std;
using namespace Binc;
//------------------------------------------------------------------------
-Request::Request(void)
- : extra(0), flags(), statuses(), bset(), searchkey(), fatt()
+Request::Request(void) : extra(0), flags(), statuses(), bset(), searchkey(), fatt()
{
uidmode = false;
}
Request::~Request(void)
{
- if (extra != 0)
- delete extra;
+ if (extra != 0) delete extra;
}
//------------------------------------------------------------------------
@@ -62,7 +62,7 @@ void Request::setMode(const string &m_in)
//------------------------------------------------------------------------
const string &Request::getMode(void) const
-{
+{
return mode;
}
@@ -218,18 +218,17 @@ vector<string> &Request::getFlags(void)
}
//------------------------------------------------------------------------
-SequenceSet::SequenceSet(void) : limited(true), nullSet(false)
-{
-}
+SequenceSet::SequenceSet(void) : limited(true), nullSet(false) {}
//------------------------------------------------------------------------
-SequenceSet::SequenceSet(const SequenceSet &copy)
- : limited(copy.limited), nullSet(copy.nullSet), internal(copy.internal)
-{
-}
+SequenceSet::SequenceSet(const SequenceSet &copy)
+ : limited(copy.limited)
+ , nullSet(copy.nullSet)
+ , internal(copy.internal)
+{}
//------------------------------------------------------------------------
-SequenceSet &SequenceSet::operator = (const SequenceSet &copy)
+SequenceSet &SequenceSet::operator=(const SequenceSet &copy)
{
limited = copy.limited;
nullSet = copy.nullSet;
@@ -239,9 +238,7 @@ SequenceSet &SequenceSet::operator = (const SequenceSet &copy)
}
//------------------------------------------------------------------------
-SequenceSet::~SequenceSet(void)
-{
-}
+SequenceSet::~SequenceSet(void) {}
//------------------------------------------------------------------------
SequenceSet &SequenceSet::null(void)
@@ -301,11 +298,12 @@ void SequenceSet::addNumber(unsigned int a)
bool SequenceSet::isInSet(unsigned int n) const
{
unsigned int maxvalue = 0;
- for (vector<Range>::const_iterator i = internal.begin();
- i != internal.end(); ++i) {
+ for (vector<Range>::const_iterator i = internal.begin(); i != internal.end(); ++i) {
const Range &r = *i;
- if (r.from > maxvalue) maxvalue = r.from;
- else if (r.to > maxvalue) maxvalue = r.to;
+ if (r.from > maxvalue)
+ maxvalue = r.from;
+ else if (r.to > maxvalue)
+ maxvalue = r.to;
if (n >= (*i).from && n <= (*i).to) {
return true;
@@ -316,11 +314,10 @@ bool SequenceSet::isInSet(unsigned int n) const
}
//------------------------------------------------------------------------
-BincImapParserFetchAtt::BincImapParserFetchAtt(const std::string &typeName)
- : type(typeName)
+BincImapParserFetchAtt::BincImapParserFetchAtt(const std::string &typeName) : type(typeName)
{
offsetstart = 0;
- offsetlength = (unsigned int) -1;
+ offsetlength = (unsigned int)-1;
hassection = false;
}
@@ -338,24 +335,21 @@ string BincImapParserFetchAtt::toString(void)
tmp += "[";
tmp += section;
if (sectiontext != "") {
- if (section != "")
- tmp += ".";
+ if (section != "") tmp += ".";
tmp += sectiontext;
if (headerlist.size() > 0) {
tmp += " (";
- for (vector<string>::iterator i = headerlist.begin();
- i != headerlist.end(); ++i) {
- if (i != headerlist.begin())
- tmp += " ";
- tmp += Binc::toImapString(*i);
- }
+ for (vector<string>::iterator i = headerlist.begin(); i != headerlist.end(); ++i) {
+ if (i != headerlist.begin()) tmp += " ";
+ tmp += Binc::toImapString(*i);
+ }
tmp += ")";
}
}
tmp += "]";
- if (offsetstart == 0 && offsetlength == (unsigned int) -1)
+ if (offsetstart == 0 && offsetlength == (unsigned int)-1)
tmp += " ";
else
tmp += "<" + Binc::toString(offsetstart) + "> ";
@@ -373,7 +367,7 @@ BincImapParserSearchKey::BincImapParserSearchKey(void)
}
//------------------------------------------------------------------------
-const SequenceSet& BincImapParserSearchKey::getSet(void) const
+const SequenceSet &BincImapParserSearchKey::getSet(void) const
{
return bset;
}