aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/addressList.cpp4
-rw-r--r--src/attachmentHelper.cpp2
-rw-r--r--src/body.cpp8
-rw-r--r--src/charset.cpp4
-rw-r--r--src/component.cpp4
-rw-r--r--src/contentDisposition.cpp4
-rw-r--r--src/dateTime.cpp30
-rw-r--r--src/disposition.cpp2
-rw-r--r--src/emptyContentHandler.cpp6
-rw-r--r--src/encoderB64.cpp4
-rw-r--r--src/encoderDefault.cpp4
-rw-r--r--src/encoderFactory.cpp2
-rw-r--r--src/encoderQP.cpp9
-rw-r--r--src/encoderUUE.cpp8
-rw-r--r--src/encoding.cpp4
-rw-r--r--src/fileAttachment.cpp12
-rw-r--r--src/header.cpp13
-rw-r--r--src/headerField.cpp2
-rw-r--r--src/htmlTextPart.cpp6
-rw-r--r--src/mailbox.cpp13
-rw-r--r--src/mailboxGroup.cpp6
-rw-r--r--src/mailboxList.cpp4
-rw-r--r--src/mdn/MDNHelper.cpp4
-rw-r--r--src/mediaType.cpp4
-rw-r--r--src/messageBuilder.cpp2
-rw-r--r--src/messageId.cpp4
-rw-r--r--src/messageIdSequence.cpp4
-rw-r--r--src/messageParser.cpp4
-rw-r--r--src/misc/importanceHelper.cpp4
-rw-r--r--src/net/defaultConnectionInfos.cpp2
-rw-r--r--src/net/events.cpp6
-rw-r--r--src/net/imap/IMAPConnection.cpp9
-rw-r--r--src/net/imap/IMAPFolder.cpp16
-rw-r--r--src/net/imap/IMAPMessage.cpp15
-rw-r--r--src/net/imap/IMAPStore.cpp10
-rw-r--r--src/net/imap/IMAPTag.cpp8
-rw-r--r--src/net/imap/IMAPUtils.cpp8
-rw-r--r--src/net/maildir/format/courierMaildirFormat.cpp10
-rw-r--r--src/net/maildir/format/kmailMaildirFormat.cpp8
-rw-r--r--src/net/maildir/maildirFolder.cpp14
-rw-r--r--src/net/maildir/maildirMessage.cpp22
-rw-r--r--src/net/maildir/maildirStore.cpp10
-rw-r--r--src/net/maildir/maildirUtils.cpp6
-rw-r--r--src/net/message.cpp2
-rw-r--r--src/net/pop3/POP3Folder.cpp14
-rw-r--r--src/net/pop3/POP3Message.cpp8
-rw-r--r--src/net/pop3/POP3Store.cpp20
-rw-r--r--src/net/sendmail/sendmailTransport.cpp6
-rw-r--r--src/net/serviceFactory.cpp2
-rw-r--r--src/net/serviceInfos.cpp6
-rw-r--r--src/net/serviceRegistration.inl2
-rw-r--r--src/net/smtp/SMTPResponse.cpp8
-rw-r--r--src/net/smtp/SMTPTransport.cpp4
-rw-r--r--src/net/tls/TLSSecuredConnectionInfos.cpp2
-rw-r--r--src/net/tls/TLSSocket.cpp4
-rw-r--r--src/net/transport.cpp2
-rw-r--r--src/parameter.cpp4
-rw-r--r--src/parameterizedHeaderField.cpp12
-rw-r--r--src/path.cpp4
-rw-r--r--src/plainTextPart.cpp2
-rw-r--r--src/platforms/posix/posixChildProcess.cpp6
-rw-r--r--src/platforms/posix/posixFile.cpp24
-rw-r--r--src/platforms/posix/posixHandler.cpp4
-rw-r--r--src/platforms/posix/posixSocket.cpp4
-rw-r--r--src/platforms/windows/windowsFile.cpp20
-rw-r--r--src/platforms/windows/windowsHandler.cpp4
-rw-r--r--src/platforms/windows/windowsSocket.cpp4
-rw-r--r--src/propertySet.cpp26
-rw-r--r--src/relay.cpp2
-rw-r--r--src/security/cert/X509Certificate.cpp9
-rw-r--r--src/security/cert/certificateChain.cpp2
-rw-r--r--src/security/digest/md5/md5MessageDigest.cpp4
-rw-r--r--src/security/digest/sha1/sha1MessageDigest.cpp14
-rw-r--r--src/security/sasl/SASLMechanismFactory.cpp4
-rw-r--r--src/security/sasl/SASLSession.cpp2
-rw-r--r--src/security/sasl/SASLSocket.cpp4
-rw-r--r--src/security/sasl/builtinSASLMechanism.cpp14
-rw-r--r--src/streamContentHandler.cpp6
-rw-r--r--src/stringContentHandler.cpp6
-rw-r--r--src/text.cpp8
-rw-r--r--src/utility/datetimeUtils.cpp8
-rw-r--r--src/utility/filteredStream.cpp8
-rw-r--r--src/utility/path.cpp14
-rw-r--r--src/utility/progressListener.cpp2
-rw-r--r--src/utility/random.cpp6
-rw-r--r--src/utility/smartPtrInt.cpp22
-rw-r--r--src/utility/stream.cpp46
-rw-r--r--src/utility/stringProxy.cpp6
-rw-r--r--src/utility/stringUtils.cpp12
-rw-r--r--src/utility/url.cpp2
-rw-r--r--src/utility/urlUtils.cpp6
-rw-r--r--src/word.cpp10
-rw-r--r--src/wordEncoder.cpp6
93 files changed, 373 insertions, 365 deletions
diff --git a/src/addressList.cpp b/src/addressList.cpp
index ca919c9b..fd7b35ce 100644
--- a/src/addressList.cpp
+++ b/src/addressList.cpp
@@ -202,13 +202,13 @@ void addressList::removeAllAddresses()
}
-const int addressList::getAddressCount() const
+int addressList::getAddressCount() const
{
return (m_list.size());
}
-const bool addressList::isEmpty() const
+bool addressList::isEmpty() const
{
return (m_list.empty());
}
diff --git a/src/attachmentHelper.cpp b/src/attachmentHelper.cpp
index 8024fe78..ec6e2f73 100644
--- a/src/attachmentHelper.cpp
+++ b/src/attachmentHelper.cpp
@@ -36,7 +36,7 @@ namespace vmime
// static
-const bool attachmentHelper::isBodyPartAnAttachment(ref <const bodyPart> part)
+bool attachmentHelper::isBodyPartAnAttachment(ref <const bodyPart> part)
{
try
{
diff --git a/src/body.cpp b/src/body.cpp
index 88414ab6..0e347623 100644
--- a/src/body.cpp
+++ b/src/body.cpp
@@ -378,7 +378,7 @@ const string body::generateRandomBoundaryString()
}
-const bool body::isValidBoundary(const string& boundary)
+bool body::isValidBoundary(const string& boundary)
{
static const string validChars("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'()+_,-./:=?");
@@ -469,7 +469,7 @@ void body::setParentPart(ref <bodyPart> parent)
}
-const bool body::isRootPart() const
+bool body::isRootPart() const
{
ref <const bodyPart> part = m_part.acquire();
return (part == NULL || part->getParentPart() == NULL);
@@ -674,13 +674,13 @@ void body::removeAllParts()
}
-const int body::getPartCount() const
+int body::getPartCount() const
{
return (m_parts.size());
}
-const bool body::isEmpty() const
+bool body::isEmpty() const
{
return (m_parts.size() == 0);
}
diff --git a/src/charset.cpp b/src/charset.cpp
index bd435faf..798d34fa 100644
--- a/src/charset.cpp
+++ b/src/charset.cpp
@@ -104,13 +104,13 @@ charset& charset::operator=(const charset& other)
}
-const bool charset::operator==(const charset& value) const
+bool charset::operator==(const charset& value) const
{
return (utility::stringUtils::isStringEqualNoCase(m_name, value.m_name));
}
-const bool charset::operator!=(const charset& value) const
+bool charset::operator!=(const charset& value) const
{
return !(*this == value);
}
diff --git a/src/component.cpp b/src/component.cpp
index 12b58081..69a60497 100644
--- a/src/component.cpp
+++ b/src/component.cpp
@@ -60,13 +60,13 @@ const string component::generate(const string::size_type maxLineLength,
}
-const string::size_type component::getParsedOffset() const
+string::size_type component::getParsedOffset() const
{
return (m_parsedOffset);
}
-const string::size_type component::getParsedLength() const
+string::size_type component::getParsedLength() const
{
return (m_parsedLength);
}
diff --git a/src/contentDisposition.cpp b/src/contentDisposition.cpp
index 476f2c0d..7ffa4244 100644
--- a/src/contentDisposition.cpp
+++ b/src/contentDisposition.cpp
@@ -77,13 +77,13 @@ contentDisposition& contentDisposition::operator=(const string& name)
}
-const bool contentDisposition::operator==(const contentDisposition& value) const
+bool contentDisposition::operator==(const contentDisposition& value) const
{
return (utility::stringUtils::toLower(m_name) == value.m_name);
}
-const bool contentDisposition::operator!=(const contentDisposition& value) const
+bool contentDisposition::operator!=(const contentDisposition& value) const
{
return !(*this == value);
}
diff --git a/src/dateTime.cpp b/src/dateTime.cpp
index 66c116fe..3af6da77 100644
--- a/src/dateTime.cpp
+++ b/src/dateTime.cpp
@@ -788,15 +788,15 @@ const std::vector <ref <const component> > datetime::getChildComponents() const
}
-const int datetime::getYear() const { return (m_year); }
-const int datetime::getMonth() const { return (m_month); }
-const int datetime::getDay() const { return (m_day); }
-const int datetime::getHour() const { return (m_hour); }
-const int datetime::getMinute() const { return (m_minute); }
-const int datetime::getSecond() const { return (m_second); }
-const int datetime::getZone() const { return (m_zone); }
-const int datetime::getWeekDay() const { return (utility::datetimeUtils::getDayOfWeek(m_year, m_month, m_day)); }
-const int datetime::getWeek() const { return utility::datetimeUtils::getWeekOfYear(m_year, m_month, m_day); }
+int datetime::getYear() const { return (m_year); }
+int datetime::getMonth() const { return (m_month); }
+int datetime::getDay() const { return (m_day); }
+int datetime::getHour() const { return (m_hour); }
+int datetime::getMinute() const { return (m_minute); }
+int datetime::getSecond() const { return (m_second); }
+int datetime::getZone() const { return (m_zone); }
+int datetime::getWeekDay() const { return (utility::datetimeUtils::getDayOfWeek(m_year, m_month, m_day)); }
+int datetime::getWeek() const { return utility::datetimeUtils::getWeekOfYear(m_year, m_month, m_day); }
void datetime::setYear(const int year) { m_year = year; }
void datetime::setMonth(const int month) { m_month = std::min(std::max(month, 1), 12); }
@@ -807,7 +807,7 @@ void datetime::setSecond(const int second) { m_second = second; }
void datetime::setZone(const int zone) { m_zone = zone; }
-const bool datetime::operator==(const datetime& other) const
+bool datetime::operator==(const datetime& other) const
{
const datetime ut1 = utility::datetimeUtils::toUniversalTime(*this);
const datetime ut2 = utility::datetimeUtils::toUniversalTime(other);
@@ -821,7 +821,7 @@ const bool datetime::operator==(const datetime& other) const
}
-const bool datetime::operator!=(const datetime& other) const
+bool datetime::operator!=(const datetime& other) const
{
const datetime ut1 = utility::datetimeUtils::toUniversalTime(*this);
const datetime ut2 = utility::datetimeUtils::toUniversalTime(other);
@@ -835,7 +835,7 @@ const bool datetime::operator!=(const datetime& other) const
}
-const bool datetime::operator<(const datetime& other) const
+bool datetime::operator<(const datetime& other) const
{
const datetime ut1 = utility::datetimeUtils::toUniversalTime(*this);
const datetime ut2 = utility::datetimeUtils::toUniversalTime(other);
@@ -849,7 +849,7 @@ const bool datetime::operator<(const datetime& other) const
}
-const bool datetime::operator<=(const datetime& other) const
+bool datetime::operator<=(const datetime& other) const
{
const datetime ut1 = utility::datetimeUtils::toUniversalTime(*this);
const datetime ut2 = utility::datetimeUtils::toUniversalTime(other);
@@ -863,7 +863,7 @@ const bool datetime::operator<=(const datetime& other) const
}
-const bool datetime::operator>(const datetime& other) const
+bool datetime::operator>(const datetime& other) const
{
const datetime ut1 = utility::datetimeUtils::toUniversalTime(*this);
const datetime ut2 = utility::datetimeUtils::toUniversalTime(other);
@@ -877,7 +877,7 @@ const bool datetime::operator>(const datetime& other) const
}
-const bool datetime::operator>=(const datetime& other) const
+bool datetime::operator>=(const datetime& other) const
{
const datetime ut1 = utility::datetimeUtils::toUniversalTime(*this);
const datetime ut2 = utility::datetimeUtils::toUniversalTime(other);
diff --git a/src/disposition.cpp b/src/disposition.cpp
index 673d7373..1b420fbc 100644
--- a/src/disposition.cpp
+++ b/src/disposition.cpp
@@ -150,7 +150,7 @@ void disposition::removeAllModifiers()
}
-const bool disposition::hasModifier(const string& modifier) const
+bool disposition::hasModifier(const string& modifier) const
{
const string modifierLC = utility::stringUtils::toLower(modifier);
diff --git a/src/emptyContentHandler.cpp b/src/emptyContentHandler.cpp
index 872b233e..bbee9864 100644
--- a/src/emptyContentHandler.cpp
+++ b/src/emptyContentHandler.cpp
@@ -72,19 +72,19 @@ void emptyContentHandler::extractRaw(utility::outputStream& /* os */,
}
-const string::size_type emptyContentHandler::getLength() const
+string::size_type emptyContentHandler::getLength() const
{
return (0);
}
-const bool emptyContentHandler::isEmpty() const
+bool emptyContentHandler::isEmpty() const
{
return (true);
}
-const bool emptyContentHandler::isEncoded() const
+bool emptyContentHandler::isEncoded() const
{
return (false);
}
diff --git a/src/encoderB64.cpp b/src/encoderB64.cpp
index 815d2278..2c16ee75 100644
--- a/src/encoderB64.cpp
+++ b/src/encoderB64.cpp
@@ -74,7 +74,7 @@ const unsigned char encoderB64::sm_decodeMap[256] =
-const utility::stream::size_type encoderB64::encode(utility::inputStream& in,
+utility::stream::size_type encoderB64::encode(utility::inputStream& in,
utility::outputStream& out, utility::progressListener* progress)
{
in.reset(); // may not work...
@@ -189,7 +189,7 @@ const utility::stream::size_type encoderB64::encode(utility::inputStream& in,
}
-const utility::stream::size_type encoderB64::decode(utility::inputStream& in,
+utility::stream::size_type encoderB64::decode(utility::inputStream& in,
utility::outputStream& out, utility::progressListener* progress)
{
in.reset(); // may not work...
diff --git a/src/encoderDefault.cpp b/src/encoderDefault.cpp
index d79bc4c4..1f2ba859 100644
--- a/src/encoderDefault.cpp
+++ b/src/encoderDefault.cpp
@@ -33,7 +33,7 @@ encoderDefault::encoderDefault()
}
-const utility::stream::size_type encoderDefault::encode(utility::inputStream& in,
+utility::stream::size_type encoderDefault::encode(utility::inputStream& in,
utility::outputStream& out, utility::progressListener* progress)
{
in.reset(); // may not work...
@@ -50,7 +50,7 @@ const utility::stream::size_type encoderDefault::encode(utility::inputStream& in
}
-const utility::stream::size_type encoderDefault::decode(utility::inputStream& in,
+utility::stream::size_type encoderDefault::decode(utility::inputStream& in,
utility::outputStream& out, utility::progressListener* progress)
{
in.reset(); // may not work...
diff --git a/src/encoderFactory.cpp b/src/encoderFactory.cpp
index 6d9d9e3c..605286be 100644
--- a/src/encoderFactory.cpp
+++ b/src/encoderFactory.cpp
@@ -81,7 +81,7 @@ const ref <const encoderFactory::registeredEncoder> encoderFactory::getEncoderBy
}
-const int encoderFactory::getEncoderCount() const
+int encoderFactory::getEncoderCount() const
{
return (m_encoders.size());
}
diff --git a/src/encoderQP.cpp b/src/encoderQP.cpp
index b9cb6238..95ca331c 100644
--- a/src/encoderQP.cpp
+++ b/src/encoderQP.cpp
@@ -89,7 +89,7 @@ const unsigned char encoderQP::sm_hexDecodeTable[256] =
#endif // VMIME_BUILDING_DOC
-const utility::stream::size_type encoderQP::encode(utility::inputStream& in,
+utility::stream::size_type encoderQP::encode(utility::inputStream& in,
utility::outputStream& out, utility::progressListener* progress)
{
in.reset(); // may not work...
@@ -305,7 +305,7 @@ const utility::stream::size_type encoderQP::encode(utility::inputStream& in,
}
-const utility::stream::size_type encoderQP::decode(utility::inputStream& in,
+utility::stream::size_type encoderQP::decode(utility::inputStream& in,
utility::outputStream& out, utility::progressListener* progress)
{
in.reset(); // may not work...
@@ -406,9 +406,8 @@ const utility::stream::size_type encoderQP::decode(utility::inputStream& in,
++inTotal;
- const unsigned char value =
- sm_hexDecodeTable[c] * 16
- + sm_hexDecodeTable[next];
+ const unsigned char value = static_cast <unsigned char>
+ (sm_hexDecodeTable[c] * 16 + sm_hexDecodeTable[next]);
outBuffer[outBufferPos++] = value;
}
diff --git a/src/encoderUUE.cpp b/src/encoderUUE.cpp
index 5aa2ffd0..ed54ffa7 100644
--- a/src/encoderUUE.cpp
+++ b/src/encoderUUE.cpp
@@ -51,19 +51,19 @@ const std::vector <string> encoderUUE::getAvailableProperties() const
// This is the character encoding function to make a character printable
-static inline const unsigned char UUENCODE(const unsigned char c)
+static inline unsigned char UUENCODE(const unsigned char c)
{
return ((c & 077) + ' ');
}
// Single character decoding
-static inline const unsigned char UUDECODE(const unsigned char c)
+static inline unsigned char UUDECODE(const unsigned char c)
{
return ((c - ' ') & 077);
}
-const utility::stream::size_type encoderUUE::encode(utility::inputStream& in,
+utility::stream::size_type encoderUUE::encode(utility::inputStream& in,
utility::outputStream& out, utility::progressListener* progress)
{
in.reset(); // may not work...
@@ -142,7 +142,7 @@ const utility::stream::size_type encoderUUE::encode(utility::inputStream& in,
}
-const utility::stream::size_type encoderUUE::decode(utility::inputStream& in,
+utility::stream::size_type encoderUUE::decode(utility::inputStream& in,
utility::outputStream& out, utility::progressListener* progress)
{
in.reset(); // may not work...
diff --git a/src/encoding.cpp b/src/encoding.cpp
index 3ab9194f..202dfe90 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -97,13 +97,13 @@ encoding& encoding::operator=(const string& name)
}
-const bool encoding::operator==(const encoding& value) const
+bool encoding::operator==(const encoding& value) const
{
return (utility::stringUtils::toLower(m_name) == value.m_name);
}
-const bool encoding::operator!=(const encoding& value) const
+bool encoding::operator!=(const encoding& value) const
{
return !(*this == value);
}
diff --git a/src/fileAttachment.cpp b/src/fileAttachment.cpp
index da4d9c4c..20b80835 100644
--- a/src/fileAttachment.cpp
+++ b/src/fileAttachment.cpp
@@ -133,24 +133,24 @@ fileAttachment::fileInfo::~fileInfo()
delete (m_readDate);
}
-const bool fileAttachment::fileInfo::hasFilename() const { return (m_filename != NULL); }
+bool fileAttachment::fileInfo::hasFilename() const { return (m_filename != NULL); }
const string& fileAttachment::fileInfo::getFilename() const { return (*m_filename); }
void fileAttachment::fileInfo::setFilename(const string& name) { if (m_filename) { *m_filename = name; } else { m_filename = new string(name); } }
-const bool fileAttachment::fileInfo::hasCreationDate() const { return (m_creationDate != NULL); }
+bool fileAttachment::fileInfo::hasCreationDate() const { return (m_creationDate != NULL); }
const datetime& fileAttachment::fileInfo::getCreationDate() const { return (*m_creationDate); }
void fileAttachment::fileInfo::setCreationDate(const datetime& date) { if (m_creationDate) { *m_creationDate = date; } else { m_creationDate = new datetime(date); } }
-const bool fileAttachment::fileInfo::hasModificationDate() const { return (m_modifDate != NULL); }
+bool fileAttachment::fileInfo::hasModificationDate() const { return (m_modifDate != NULL); }
const datetime& fileAttachment::fileInfo::getModificationDate() const { return (*m_modifDate); }
void fileAttachment::fileInfo::setModificationDate(const datetime& date) { if (m_modifDate) { *m_modifDate = date; } else { m_modifDate = new datetime(date); } }
-const bool fileAttachment::fileInfo::hasReadDate() const { return (m_readDate != NULL); }
+bool fileAttachment::fileInfo::hasReadDate() const { return (m_readDate != NULL); }
const datetime& fileAttachment::fileInfo::getReadDate() const { return (*m_readDate); }
void fileAttachment::fileInfo::setReadDate(const datetime& date) { if (m_readDate) { *m_readDate = date; } else { m_readDate = new datetime(date); } }
-const bool fileAttachment::fileInfo::hasSize() const { return (m_size != NULL); }
-const unsigned int fileAttachment::fileInfo::getSize() const { return (*m_size); }
+bool fileAttachment::fileInfo::hasSize() const { return (m_size != NULL); }
+unsigned int fileAttachment::fileInfo::getSize() const { return (*m_size); }
void fileAttachment::fileInfo::setSize(const unsigned int& size) { if (m_size) { *m_size = size; } else { m_size = new unsigned int(size); } }
diff --git a/src/header.cpp b/src/header.cpp
index ac5816d4..78424b3e 100644
--- a/src/header.cpp
+++ b/src/header.cpp
@@ -143,7 +143,7 @@ header& header::operator=(const header& other)
}
-const bool header::hasField(const string& fieldName) const
+bool header::hasField(const string& fieldName) const
{
std::vector <ref <headerField> >::const_iterator pos =
std::find_if(m_fields.begin(), m_fields.end(),
@@ -193,7 +193,8 @@ ref <headerField> header::getField(const string& fieldName)
std::vector <ref <headerField> >::const_iterator pos = m_fields.begin();
const std::vector <ref <headerField> >::const_iterator end = m_fields.end();
- for ( ; pos != end && utility::stringUtils::toLower((*pos)->getName()) != name ; ++pos);
+ while (pos != end && utility::stringUtils::toLower((*pos)->getName()) != name)
+ ++pos;
// If no field with this name can be found, create a new one
if (pos == end)
@@ -290,13 +291,13 @@ void header::removeAllFields(const string& fieldName)
}
-const int header::getFieldCount() const
+int header::getFieldCount() const
{
return (m_fields.size());
}
-const bool header::isEmpty() const
+bool header::isEmpty() const
{
return (m_fields.empty());
}
@@ -355,7 +356,7 @@ header::fieldHasName::fieldHasName(const string& name)
{
}
-const bool header::fieldHasName::operator() (const ref <const headerField>& field)
+bool header::fieldHasName::operator() (const ref <const headerField>& field)
{
return utility::stringUtils::toLower(field->getName()) == m_name;
}
@@ -366,7 +367,7 @@ header::fieldHasNotName::fieldHasNotName(const string& name)
{
}
-const bool header::fieldHasNotName::operator() (const ref <const headerField>& field)
+bool header::fieldHasNotName::operator() (const ref <const headerField>& field)
{
return utility::stringUtils::toLower(field->getName()) != m_name;
}
diff --git a/src/headerField.cpp b/src/headerField.cpp
index a2edd212..00577129 100644
--- a/src/headerField.cpp
+++ b/src/headerField.cpp
@@ -284,7 +284,7 @@ void headerField::setName(const string& name)
}
-const bool headerField::isCustom() const
+bool headerField::isCustom() const
{
return (m_name.length() > 2 && m_name[0] == 'X' && m_name[1] == '-');
}
diff --git a/src/htmlTextPart.cpp b/src/htmlTextPart.cpp
index 962ec5f7..a2875737 100644
--- a/src/htmlTextPart.cpp
+++ b/src/htmlTextPart.cpp
@@ -54,7 +54,7 @@ const mediaType htmlTextPart::getType() const
}
-const int htmlTextPart::getPartCount() const
+int htmlTextPart::getPartCount() const
{
return (m_plainText->isEmpty() ? 1 : 2);
}
@@ -382,7 +382,7 @@ void htmlTextPart::setText(ref <contentHandler> text)
}
-const int htmlTextPart::getObjectCount() const
+int htmlTextPart::getObjectCount() const
{
return m_objects.size();
}
@@ -409,7 +409,7 @@ const ref <const htmlTextPart::embeddedObject> htmlTextPart::findObject(const st
}
-const bool htmlTextPart::hasObject(const string& id_) const
+bool htmlTextPart::hasObject(const string& id_) const
{
const string id = cleanId(id_);
diff --git a/src/mailbox.cpp b/src/mailbox.cpp
index dfe55e09..b1ed7a28 100644
--- a/src/mailbox.cpp
+++ b/src/mailbox.cpp
@@ -165,7 +165,10 @@ void mailbox::parse(const string& buffer, const string::size_type position,
{
// Erase any space between display name and <address>
string::iterator q = name.end();
- for ( ; q != name.begin() && parserHelpers::isSpace(*(q - 1)) ; --q);
+
+ while (q != name.begin() && parserHelpers::isSpace(*(q - 1)))
+ --q;
+
name.erase(q, name.end());
break;
@@ -431,13 +434,13 @@ void mailbox::generate(utility::outputStream& os, const string::size_type maxLin
}
-const bool mailbox::operator==(const class mailbox& mailbox) const
+bool mailbox::operator==(const class mailbox& mailbox) const
{
return (m_name == mailbox.m_name && m_email == mailbox.m_email);
}
-const bool mailbox::operator!=(const class mailbox& mailbox) const
+bool mailbox::operator!=(const class mailbox& mailbox) const
{
return !(*this == mailbox);
}
@@ -465,7 +468,7 @@ ref <component>mailbox::clone() const
}
-const bool mailbox::isEmpty() const
+bool mailbox::isEmpty() const
{
return (m_email.empty());
}
@@ -478,7 +481,7 @@ void mailbox::clear()
}
-const bool mailbox::isGroup() const
+bool mailbox::isGroup() const
{
return (false);
}
diff --git a/src/mailboxGroup.cpp b/src/mailboxGroup.cpp
index de209eb1..ac7202cd 100644
--- a/src/mailboxGroup.cpp
+++ b/src/mailboxGroup.cpp
@@ -228,13 +228,13 @@ void mailboxGroup::setName(const text& name)
}
-const bool mailboxGroup::isGroup() const
+bool mailboxGroup::isGroup() const
{
return (true);
}
-const bool mailboxGroup::isEmpty() const
+bool mailboxGroup::isEmpty() const
{
return (m_list.empty());
}
@@ -308,7 +308,7 @@ void mailboxGroup::removeAllMailboxes()
}
-const int mailboxGroup::getMailboxCount() const
+int mailboxGroup::getMailboxCount() const
{
return (m_list.size());
}
diff --git a/src/mailboxList.cpp b/src/mailboxList.cpp
index 47bb386f..e9fe7f92 100644
--- a/src/mailboxList.cpp
+++ b/src/mailboxList.cpp
@@ -109,13 +109,13 @@ void mailboxList::removeAllMailboxes()
}
-const int mailboxList::getMailboxCount() const
+int mailboxList::getMailboxCount() const
{
return (m_list.getAddressCount());
}
-const bool mailboxList::isEmpty() const
+bool mailboxList::isEmpty() const
{
return (m_list.isEmpty());
}
diff --git a/src/mdn/MDNHelper.cpp b/src/mdn/MDNHelper.cpp
index f9419a3c..a4a4ee4f 100644
--- a/src/mdn/MDNHelper.cpp
+++ b/src/mdn/MDNHelper.cpp
@@ -72,7 +72,7 @@ const std::vector <sendableMDNInfos> MDNHelper::getPossibleMDNs(const ref <const
}
-const bool MDNHelper::isMDN(const ref <const message> msg)
+bool MDNHelper::isMDN(const ref <const message> msg)
{
const ref <const header> hdr = msg->getHeader();
@@ -111,7 +111,7 @@ receivedMDNInfos MDNHelper::getReceivedMDN(const ref <const message> msg)
}
-const bool MDNHelper::needConfirmation(const ref <const message> msg)
+bool MDNHelper::needConfirmation(const ref <const message> msg)
{
ref <const header> hdr = msg->getHeader();
diff --git a/src/mediaType.cpp b/src/mediaType.cpp
index 71acc2f2..569ccc38 100644
--- a/src/mediaType.cpp
+++ b/src/mediaType.cpp
@@ -105,13 +105,13 @@ void mediaType::generate(utility::outputStream& os, const string::size_type maxL
}
-const bool mediaType::operator==(const mediaType& type) const
+bool mediaType::operator==(const mediaType& type) const
{
return (m_type == type.m_type && m_subType == type.m_subType);
}
-const bool mediaType::operator!=(const mediaType& type) const
+bool mediaType::operator!=(const mediaType& type) const
{
return !(*this == type);
}
diff --git a/src/messageBuilder.cpp b/src/messageBuilder.cpp
index 1d2ba7c7..cef4f734 100644
--- a/src/messageBuilder.cpp
+++ b/src/messageBuilder.cpp
@@ -291,7 +291,7 @@ ref <attachment> messageBuilder::getAttachmentAt(const int pos)
}
-const int messageBuilder::getAttachmentCount() const
+int messageBuilder::getAttachmentCount() const
{
return (m_attach.size());
}
diff --git a/src/messageId.cpp b/src/messageId.cpp
index 72cda2a0..08a8e379 100644
--- a/src/messageId.cpp
+++ b/src/messageId.cpp
@@ -230,13 +230,13 @@ messageId messageId::generateId()
}
-const bool messageId::operator==(const messageId& mid) const
+bool messageId::operator==(const messageId& mid) const
{
return (m_left == mid.m_left && m_right == mid.m_right);
}
-const bool messageId::operator!=(const messageId& mid) const
+bool messageId::operator!=(const messageId& mid) const
{
return !(*this == mid);
}
diff --git a/src/messageIdSequence.cpp b/src/messageIdSequence.cpp
index c0337608..60113583 100644
--- a/src/messageIdSequence.cpp
+++ b/src/messageIdSequence.cpp
@@ -198,13 +198,13 @@ void messageIdSequence::removeAllMessageIds()
}
-const int messageIdSequence::getMessageIdCount() const
+int messageIdSequence::getMessageIdCount() const
{
return (m_list.size());
}
-const bool messageIdSequence::isEmpty() const
+bool messageIdSequence::isEmpty() const
{
return (m_list.empty());
}
diff --git a/src/messageParser.cpp b/src/messageParser.cpp
index 012be6c0..639ac5ff 100644
--- a/src/messageParser.cpp
+++ b/src/messageParser.cpp
@@ -279,7 +279,7 @@ const std::vector <ref <const attachment> > messageParser::getAttachmentList() c
}
-const int messageParser::getAttachmentCount() const
+int messageParser::getAttachmentCount() const
{
return (m_attach.size());
}
@@ -307,7 +307,7 @@ const std::vector <ref <const textPart> > messageParser::getTextPartList() const
}
-const int messageParser::getTextPartCount() const
+int messageParser::getTextPartCount() const
{
return (m_textParts.size());
}
diff --git a/src/misc/importanceHelper.cpp b/src/misc/importanceHelper.cpp
index ff4dc53b..763753c6 100644
--- a/src/misc/importanceHelper.cpp
+++ b/src/misc/importanceHelper.cpp
@@ -61,13 +61,13 @@ void importanceHelper::resetImportanceHeader(ref <header> hdr)
}
-const importanceHelper::Importance importanceHelper::getImportance(ref <const message> msg)
+importanceHelper::Importance importanceHelper::getImportance(ref <const message> msg)
{
return getImportanceHeader(msg->getHeader());
}
-const importanceHelper::Importance importanceHelper::getImportanceHeader(ref <const header> hdr)
+importanceHelper::Importance importanceHelper::getImportanceHeader(ref <const header> hdr)
{
// Try "X-Priority" field
try
diff --git a/src/net/defaultConnectionInfos.cpp b/src/net/defaultConnectionInfos.cpp
index 97d1a7f7..ee706a34 100644
--- a/src/net/defaultConnectionInfos.cpp
+++ b/src/net/defaultConnectionInfos.cpp
@@ -40,7 +40,7 @@ const string defaultConnectionInfos::getHost() const
}
-const port_t defaultConnectionInfos::getPort() const
+port_t defaultConnectionInfos::getPort() const
{
return m_port;
}
diff --git a/src/net/events.cpp b/src/net/events.cpp
index 69fbc336..a6674a79 100644
--- a/src/net/events.cpp
+++ b/src/net/events.cpp
@@ -46,7 +46,7 @@ messageCountEvent::messageCountEvent
ref <folder> messageCountEvent::getFolder() const { return (m_folder); }
-const messageCountEvent::Types messageCountEvent::getType() const { return (m_type); }
+messageCountEvent::Types messageCountEvent::getType() const { return (m_type); }
const std::vector <int>& messageCountEvent::getNumbers() const { return (m_nums); }
@@ -73,7 +73,7 @@ messageChangedEvent::messageChangedEvent
ref <folder> messageChangedEvent::getFolder() const { return (m_folder); }
-const messageChangedEvent::Types messageChangedEvent::getType() const { return (m_type); }
+messageChangedEvent::Types messageChangedEvent::getType() const { return (m_type); }
const std::vector <int>& messageChangedEvent::getNumbers() const { return (m_nums); }
@@ -96,7 +96,7 @@ folderEvent::folderEvent
ref <folder> folderEvent::getFolder() const { return (m_folder); }
-const folderEvent::Types folderEvent::getType() const { return (m_type); }
+folderEvent::Types folderEvent::getType() const { return (m_type); }
void folderEvent::dispatch(folderListener* listener) const
diff --git a/src/net/imap/IMAPConnection.cpp b/src/net/imap/IMAPConnection.cpp
index 69ef337d..7c78b788 100644
--- a/src/net/imap/IMAPConnection.cpp
+++ b/src/net/imap/IMAPConnection.cpp
@@ -531,14 +531,14 @@ ref <security::authenticator> IMAPConnection::getAuthenticator()
}
-const bool IMAPConnection::isConnected() const
+bool IMAPConnection::isConnected() const
{
return (m_socket && m_socket->isConnected() &&
(m_state == STATE_AUTHENTICATED || m_state == STATE_SELECTED));
}
-const bool IMAPConnection::isSecuredConnection() const
+bool IMAPConnection::isSecuredConnection() const
{
return m_secured;
}
@@ -670,7 +670,7 @@ IMAPParser::response* IMAPConnection::readResponse(IMAPParser::literalHandler* l
}
-const IMAPConnection::ProtocolStates IMAPConnection::state() const
+IMAPConnection::ProtocolStates IMAPConnection::state() const
{
return (m_state);
}
@@ -681,7 +681,8 @@ void IMAPConnection::setState(const ProtocolStates state)
m_state = state;
}
-const char IMAPConnection::hierarchySeparator() const
+
+char IMAPConnection::hierarchySeparator() const
{
return (m_hierarchySeparator);
}
diff --git a/src/net/imap/IMAPFolder.cpp b/src/net/imap/IMAPFolder.cpp
index daf20918..2130211c 100644
--- a/src/net/imap/IMAPFolder.cpp
+++ b/src/net/imap/IMAPFolder.cpp
@@ -71,7 +71,7 @@ IMAPFolder::~IMAPFolder()
}
-const int IMAPFolder::getMode() const
+int IMAPFolder::getMode() const
{
if (!isOpen())
throw exceptions::illegal_state("Folder not open");
@@ -80,7 +80,7 @@ const int IMAPFolder::getMode() const
}
-const int IMAPFolder::getType()
+int IMAPFolder::getType()
{
if (!isOpen())
throw exceptions::illegal_state("Folder not open");
@@ -100,7 +100,7 @@ const int IMAPFolder::getType()
}
-const int IMAPFolder::getFlags()
+int IMAPFolder::getFlags()
{
if (!isOpen())
throw exceptions::illegal_state("Folder not open");
@@ -412,7 +412,7 @@ void IMAPFolder::destroy()
}
-const bool IMAPFolder::exists()
+bool IMAPFolder::exists()
{
ref <IMAPStore> store = m_store.acquire();
@@ -423,7 +423,7 @@ const bool IMAPFolder::exists()
}
-const int IMAPFolder::testExistAndGetType()
+int IMAPFolder::testExistAndGetType()
{
m_type = TYPE_UNDEFINED;
@@ -495,7 +495,7 @@ const int IMAPFolder::testExistAndGetType()
}
-const bool IMAPFolder::isOpen() const
+bool IMAPFolder::isOpen() const
{
return (m_open);
}
@@ -548,7 +548,7 @@ std::vector <ref <message> > IMAPFolder::getMessages(const std::vector <int>& nu
}
-const int IMAPFolder::getMessageCount()
+int IMAPFolder::getMessageCount()
{
if (!isOpen())
throw exceptions::illegal_state("Folder not open");
@@ -761,7 +761,7 @@ void IMAPFolder::fetchMessage(ref <message> msg, const int options)
}
-const int IMAPFolder::getFetchCapabilities() const
+int IMAPFolder::getFetchCapabilities() const
{
return (FETCH_ENVELOPE | FETCH_CONTENT_INFO | FETCH_STRUCTURE |
FETCH_FLAGS | FETCH_SIZE | FETCH_FULL_HEADER | FETCH_UID |
diff --git a/src/net/imap/IMAPMessage.cpp b/src/net/imap/IMAPMessage.cpp
index 8e4bcc40..90bebf39 100644
--- a/src/net/imap/IMAPMessage.cpp
+++ b/src/net/imap/IMAPMessage.cpp
@@ -30,6 +30,7 @@
#include <sstream>
#include <iterator>
+#include <typeinfo>
namespace vmime {
@@ -60,8 +61,8 @@ public:
ref <const IMAPpart> getParent() const { return m_parent.acquire(); }
const mediaType& getType() const { return (m_mediaType); }
- const int getSize() const { return (m_size); }
- const int getNumber() const { return (m_number); }
+ int getSize() const { return (m_size); }
+ int getNumber() const { return (m_number); }
ref <const header> getHeader() const
{
@@ -149,7 +150,7 @@ public:
return m_parts[x];
}
- const int getPartCount() const
+ int getPartCount() const
{
return m_parts.size();
}
@@ -299,7 +300,7 @@ void IMAPMessage::onFolderClosed()
}
-const int IMAPMessage::getNumber() const
+int IMAPMessage::getNumber() const
{
return (m_num);
}
@@ -311,7 +312,7 @@ const message::uid IMAPMessage::getUniqueId() const
}
-const int IMAPMessage::getSize() const
+int IMAPMessage::getSize() const
{
if (m_size == -1)
throw exceptions::unfetched_object();
@@ -320,13 +321,13 @@ const int IMAPMessage::getSize() const
}
-const bool IMAPMessage::isExpunged() const
+bool IMAPMessage::isExpunged() const
{
return (m_expunged);
}
-const int IMAPMessage::getFlags() const
+int IMAPMessage::getFlags() const
{
if (m_flags == FLAG_UNDEFINED)
throw exceptions::unfetched_object();
diff --git a/src/net/imap/IMAPStore.cpp b/src/net/imap/IMAPStore.cpp
index 53fa9e80..753adc65 100644
--- a/src/net/imap/IMAPStore.cpp
+++ b/src/net/imap/IMAPStore.cpp
@@ -91,7 +91,7 @@ ref <folder> IMAPStore::getFolder(const folder::path& path)
}
-const bool IMAPStore::isValidFolderName(const folder::path::component& /* name */) const
+bool IMAPStore::isValidFolderName(const folder::path::component& /* name */) const
{
return true;
}
@@ -117,19 +117,19 @@ void IMAPStore::connect()
}
-const bool IMAPStore::isConnected() const
+bool IMAPStore::isConnected() const
{
return (m_connection && m_connection->isConnected());
}
-const bool IMAPStore::isIMAPS() const
+bool IMAPStore::isIMAPS() const
{
return m_isIMAPS;
}
-const bool IMAPStore::isSecuredConnection() const
+bool IMAPStore::isSecuredConnection() const
{
if (m_connection == NULL)
return false;
@@ -203,7 +203,7 @@ void IMAPStore::unregisterFolder(IMAPFolder* folder)
}
-const int IMAPStore::getCapabilities() const
+int IMAPStore::getCapabilities() const
{
return (CAPABILITY_CREATE_FOLDER |
CAPABILITY_RENAME_FOLDER |
diff --git a/src/net/imap/IMAPTag.cpp b/src/net/imap/IMAPTag.cpp
index 87902c30..7b8ce3fc 100644
--- a/src/net/imap/IMAPTag.cpp
+++ b/src/net/imap/IMAPTag.cpp
@@ -74,7 +74,7 @@ const IMAPTag IMAPTag::operator++(int)
}
-const int IMAPTag::number() const
+int IMAPTag::number() const
{
return (m_number);
}
@@ -92,9 +92,9 @@ void IMAPTag::generate()
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
m_tag[0] = prefixChars[m_number / 1000];
- m_tag[1] = '0' + (m_number % 1000) / 100;
- m_tag[2] = '0' + (m_number % 100) / 10;
- m_tag[3] = '0' + (m_number % 10);
+ m_tag[1] = static_cast <char>('0' + (m_number % 1000) / 100);
+ m_tag[2] = static_cast <char>('0' + (m_number % 100) / 10);
+ m_tag[3] = static_cast <char>('0' + m_number % 10);
}
diff --git a/src/net/imap/IMAPUtils.cpp b/src/net/imap/IMAPUtils.cpp
index 98157ae8..18ca00cb 100644
--- a/src/net/imap/IMAPUtils.cpp
+++ b/src/net/imap/IMAPUtils.cpp
@@ -272,7 +272,7 @@ const string IMAPUtils::toModifiedUTF7
base64 = false;
}
- out += ch;
+ out += static_cast <string::value_type>(ch);
if (ch == '&')
out += '-';
@@ -358,7 +358,7 @@ const folder::path::component IMAPUtils::fromModifiedUTF7(const string& text)
}
-const int IMAPUtils::folderTypeFromFlags(const IMAPParser::mailbox_flag_list* list)
+int IMAPUtils::folderTypeFromFlags(const IMAPParser::mailbox_flag_list* list)
{
// Get folder type
int type = folder::TYPE_CONTAINS_MESSAGES | folder::TYPE_CONTAINS_FOLDERS;
@@ -378,7 +378,7 @@ const int IMAPUtils::folderTypeFromFlags(const IMAPParser::mailbox_flag_list* li
}
-const int IMAPUtils::folderFlagsFromFlags(const IMAPParser::mailbox_flag_list* list)
+int IMAPUtils::folderFlagsFromFlags(const IMAPParser::mailbox_flag_list* list)
{
// Get folder flags
int folderFlags = folder::FLAG_CHILDREN;
@@ -397,7 +397,7 @@ const int IMAPUtils::folderFlagsFromFlags(const IMAPParser::mailbox_flag_list* l
}
-const int IMAPUtils::messageFlagsFromFlags(const IMAPParser::flag_list* list)
+int IMAPUtils::messageFlagsFromFlags(const IMAPParser::flag_list* list)
{
const std::vector <IMAPParser::flag*>& flagList = list->flags();
int flags = 0;
diff --git a/src/net/maildir/format/courierMaildirFormat.cpp b/src/net/maildir/format/courierMaildirFormat.cpp
index 82a3b188..1118c279 100644
--- a/src/net/maildir/format/courierMaildirFormat.cpp
+++ b/src/net/maildir/format/courierMaildirFormat.cpp
@@ -132,7 +132,7 @@ void courierMaildirFormat::renameFolderImpl
}
-const bool courierMaildirFormat::folderExists(const folder::path& path) const
+bool courierMaildirFormat::folderExists(const folder::path& path) const
{
utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
@@ -164,7 +164,7 @@ const bool courierMaildirFormat::folderExists(const folder::path& path) const
}
-const bool courierMaildirFormat::folderHasSubfolders(const folder::path& path) const
+bool courierMaildirFormat::folderHasSubfolders(const folder::path& path) const
{
std::vector <string> dirs;
return listDirectories(path, dirs, true);
@@ -251,7 +251,7 @@ const std::vector <folder::path> courierMaildirFormat::listFolders
}
-const bool courierMaildirFormat::listDirectories(const folder::path& root,
+bool courierMaildirFormat::listDirectories(const folder::path& root,
std::vector <string>& dirs, const bool onlyTestForExistence) const
{
utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
@@ -304,7 +304,7 @@ const bool courierMaildirFormat::listDirectories(const folder::path& root,
// static
-const bool courierMaildirFormat::isSubfolderDirectory(const utility::file& file)
+bool courierMaildirFormat::isSubfolderDirectory(const utility::file& file)
{
// A directory which names starts with '.' may be a subfolder
if (file.isDirectory() &&
@@ -494,7 +494,7 @@ const folder::path::component courierMaildirFormat::fromModifiedUTF7(const strin
}
-const bool courierMaildirFormat::supports() const
+bool courierMaildirFormat::supports() const
{
utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
diff --git a/src/net/maildir/format/kmailMaildirFormat.cpp b/src/net/maildir/format/kmailMaildirFormat.cpp
index c6293ace..eeedd416 100644
--- a/src/net/maildir/format/kmailMaildirFormat.cpp
+++ b/src/net/maildir/format/kmailMaildirFormat.cpp
@@ -85,7 +85,7 @@ void kmailMaildirFormat::destroyFolder(const folder::path& path)
}
-const bool kmailMaildirFormat::folderExists(const folder::path& path) const
+bool kmailMaildirFormat::folderExists(const folder::path& path) const
{
utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
@@ -210,7 +210,7 @@ void kmailMaildirFormat::listFoldersImpl
// static
-const bool kmailMaildirFormat::isSubfolderDirectory(const utility::file& file)
+bool kmailMaildirFormat::isSubfolderDirectory(const utility::file& file)
{
// A directory which name does not start with '.' is listed as a sub-folder
if (file.isDirectory() &&
@@ -275,7 +275,7 @@ void kmailMaildirFormat::renameFolder(const folder::path& oldPath, const folder:
}
-const bool kmailMaildirFormat::folderHasSubfolders(const folder::path& path) const
+bool kmailMaildirFormat::folderHasSubfolders(const folder::path& path) const
{
utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
@@ -296,7 +296,7 @@ const bool kmailMaildirFormat::folderHasSubfolders(const folder::path& path) con
}
-const bool kmailMaildirFormat::supports() const
+bool kmailMaildirFormat::supports() const
{
// This is the default
return true;
diff --git a/src/net/maildir/maildirFolder.cpp b/src/net/maildir/maildirFolder.cpp
index 4f5903e2..4f0acaf3 100644
--- a/src/net/maildir/maildirFolder.cpp
+++ b/src/net/maildir/maildirFolder.cpp
@@ -74,7 +74,7 @@ void maildirFolder::onStoreDisconnected()
}
-const int maildirFolder::getMode() const
+int maildirFolder::getMode() const
{
if (!isOpen())
throw exceptions::illegal_state("Folder not open");
@@ -83,7 +83,7 @@ const int maildirFolder::getMode() const
}
-const int maildirFolder::getType()
+int maildirFolder::getType()
{
if (m_path.isEmpty())
return (TYPE_CONTAINS_FOLDERS);
@@ -92,7 +92,7 @@ const int maildirFolder::getType()
}
-const int maildirFolder::getFlags()
+int maildirFolder::getFlags()
{
int flags = 0;
@@ -241,7 +241,7 @@ void maildirFolder::destroy()
}
-const bool maildirFolder::exists()
+bool maildirFolder::exists()
{
ref <maildirStore> store = m_store.acquire();
@@ -249,7 +249,7 @@ const bool maildirFolder::exists()
}
-const bool maildirFolder::isOpen() const
+bool maildirFolder::isOpen() const
{
return (m_open);
}
@@ -441,7 +441,7 @@ std::vector <ref <message> > maildirFolder::getMessages(const std::vector <int>&
}
-const int maildirFolder::getMessageCount()
+int maildirFolder::getMessageCount()
{
return (m_messageCount);
}
@@ -1339,7 +1339,7 @@ void maildirFolder::fetchMessage(ref <message> msg, const int options)
}
-const int maildirFolder::getFetchCapabilities() const
+int maildirFolder::getFetchCapabilities() const
{
return (FETCH_ENVELOPE | FETCH_STRUCTURE | FETCH_CONTENT_INFO |
FETCH_FLAGS | FETCH_SIZE | FETCH_FULL_HEADER | FETCH_UID |
diff --git a/src/net/maildir/maildirMessage.cpp b/src/net/maildir/maildirMessage.cpp
index 3ed42ba6..1ae83eed 100644
--- a/src/net/maildir/maildirMessage.cpp
+++ b/src/net/maildir/maildirMessage.cpp
@@ -57,8 +57,8 @@ public:
weak_ref <const maildirPart> getParent() const { return (m_parent); }
const mediaType& getType() const { return (m_mediaType); }
- const int getSize() const { return (m_size); }
- const int getNumber() const { return (m_number); }
+ int getSize() const { return (m_size); }
+ int getNumber() const { return (m_number); }
ref <const header> getHeader() const
{
@@ -76,11 +76,11 @@ public:
return (*(m_header = vmime::create <header>()));
}
- const int getHeaderParsedOffset() const { return (m_headerParsedOffset); }
- const int getHeaderParsedLength() const { return (m_headerParsedLength); }
+ int getHeaderParsedOffset() const { return (m_headerParsedOffset); }
+ int getHeaderParsedLength() const { return (m_headerParsedLength); }
- const int getBodyParsedOffset() const { return (m_bodyParsedOffset); }
- const int getBodyParsedLength() const { return (m_bodyParsedLength); }
+ int getBodyParsedOffset() const { return (m_bodyParsedOffset); }
+ int getBodyParsedLength() const { return (m_bodyParsedLength); }
void initStructure(const bodyPart& part);
@@ -145,7 +145,7 @@ public:
return m_parts[x];
}
- const int getPartCount() const
+ int getPartCount() const
{
return m_parts.size();
}
@@ -247,7 +247,7 @@ void maildirMessage::onFolderClosed()
}
-const int maildirMessage::getNumber() const
+int maildirMessage::getNumber() const
{
return (m_num);
}
@@ -259,7 +259,7 @@ const message::uid maildirMessage::getUniqueId() const
}
-const int maildirMessage::getSize() const
+int maildirMessage::getSize() const
{
if (m_size == -1)
throw exceptions::unfetched_object();
@@ -268,7 +268,7 @@ const int maildirMessage::getSize() const
}
-const bool maildirMessage::isExpunged() const
+bool maildirMessage::isExpunged() const
{
return (m_expunged);
}
@@ -301,7 +301,7 @@ ref <const header> maildirMessage::getHeader() const
}
-const int maildirMessage::getFlags() const
+int maildirMessage::getFlags() const
{
if (m_flags == FLAG_UNDEFINED)
throw exceptions::unfetched_object();
diff --git a/src/net/maildir/maildirStore.cpp b/src/net/maildir/maildirStore.cpp
index 746cd099..8e4e0029 100644
--- a/src/net/maildir/maildirStore.cpp
+++ b/src/net/maildir/maildirStore.cpp
@@ -104,7 +104,7 @@ ref <folder> maildirStore::getFolder(const folder::path& path)
}
-const bool maildirStore::isValidFolderName(const folder::path::component& name) const
+bool maildirStore::isValidFolderName(const folder::path::component& name) const
{
if (!platform::getHandler()->getFileSystemFactory()->isValidPathComponent(name))
return false;
@@ -157,13 +157,13 @@ void maildirStore::connect()
}
-const bool maildirStore::isConnected() const
+bool maildirStore::isConnected() const
{
return (m_connected);
}
-const bool maildirStore::isSecuredConnection() const
+bool maildirStore::isSecuredConnection() const
{
return false;
}
@@ -171,7 +171,7 @@ const bool maildirStore::isSecuredConnection() const
ref <connectionInfos> maildirStore::getConnectionInfos() const
{
- return vmime::create <defaultConnectionInfos>("localhost", 0);
+ return vmime::create <defaultConnectionInfos>("localhost", static_cast <port_t>(0));
}
@@ -226,7 +226,7 @@ const utility::path& maildirStore::getFileSystemPath() const
}
-const int maildirStore::getCapabilities() const
+int maildirStore::getCapabilities() const
{
return (CAPABILITY_CREATE_FOLDER |
CAPABILITY_RENAME_FOLDER |
diff --git a/src/net/maildir/maildirUtils.cpp b/src/net/maildir/maildirUtils.cpp
index cd688b08..67d52fe6 100644
--- a/src/net/maildir/maildirUtils.cpp
+++ b/src/net/maildir/maildirUtils.cpp
@@ -34,7 +34,7 @@ namespace net {
namespace maildir {
-const bool maildirUtils::isMessageFile(const utility::file& file)
+bool maildirUtils::isMessageFile(const utility::file& file)
{
// Ignore files which name begins with '.'
if (file.isFile() &&
@@ -77,7 +77,7 @@ const utility::file::path::component maildirUtils::extractId
}
-const int maildirUtils::extractFlags(const utility::file::path::component& comp)
+int maildirUtils::extractFlags(const utility::file::path::component& comp)
{
string::size_type sep = comp.getBuffer().rfind(':'); // try colon
@@ -208,7 +208,7 @@ maildirUtils::messageIdComparator::messageIdComparator
}
-const bool maildirUtils::messageIdComparator::operator()
+bool maildirUtils::messageIdComparator::operator()
(const utility::file::path::component& other) const
{
return (m_comp == maildirUtils::extractId(other));
diff --git a/src/net/message.cpp b/src/net/message.cpp
index f1a231a9..37f020b3 100644
--- a/src/net/message.cpp
+++ b/src/net/message.cpp
@@ -40,7 +40,7 @@ ref <part> part::getPartAt(const int pos)
}
-const int part::getPartCount() const
+int part::getPartCount() const
{
return getStructure()->getPartCount();
}
diff --git a/src/net/pop3/POP3Folder.cpp b/src/net/pop3/POP3Folder.cpp
index 0b20878d..ba70f2b1 100644
--- a/src/net/pop3/POP3Folder.cpp
+++ b/src/net/pop3/POP3Folder.cpp
@@ -63,7 +63,7 @@ POP3Folder::~POP3Folder()
}
-const int POP3Folder::getMode() const
+int POP3Folder::getMode() const
{
if (!isOpen())
throw exceptions::illegal_state("Folder not open");
@@ -72,7 +72,7 @@ const int POP3Folder::getMode() const
}
-const int POP3Folder::getType()
+int POP3Folder::getType()
{
if (!isOpen())
throw exceptions::illegal_state("Folder not open");
@@ -86,7 +86,7 @@ const int POP3Folder::getType()
}
-const int POP3Folder::getFlags()
+int POP3Folder::getFlags()
{
return (0);
}
@@ -194,7 +194,7 @@ void POP3Folder::destroy()
}
-const bool POP3Folder::exists()
+bool POP3Folder::exists()
{
ref <POP3Store> store = m_store.acquire();
@@ -205,7 +205,7 @@ const bool POP3Folder::exists()
}
-const bool POP3Folder::isOpen() const
+bool POP3Folder::isOpen() const
{
return (m_open);
}
@@ -273,7 +273,7 @@ std::vector <ref <message> > POP3Folder::getMessages(const std::vector <int>& nu
}
-const int POP3Folder::getMessageCount()
+int POP3Folder::getMessageCount()
{
ref <POP3Store> store = m_store.acquire();
@@ -517,7 +517,7 @@ void POP3Folder::fetchMessage(ref <message> msg, const int options)
}
-const int POP3Folder::getFetchCapabilities() const
+int POP3Folder::getFetchCapabilities() const
{
return (FETCH_ENVELOPE | FETCH_CONTENT_INFO |
FETCH_SIZE | FETCH_FULL_HEADER | FETCH_UID |
diff --git a/src/net/pop3/POP3Message.cpp b/src/net/pop3/POP3Message.cpp
index ace7d7c8..6cdd4557 100644
--- a/src/net/pop3/POP3Message.cpp
+++ b/src/net/pop3/POP3Message.cpp
@@ -55,7 +55,7 @@ void POP3Message::onFolderClosed()
}
-const int POP3Message::getNumber() const
+int POP3Message::getNumber() const
{
return (m_num);
}
@@ -67,7 +67,7 @@ const message::uid POP3Message::getUniqueId() const
}
-const int POP3Message::getSize() const
+int POP3Message::getSize() const
{
if (m_size == -1)
throw exceptions::unfetched_object();
@@ -76,13 +76,13 @@ const int POP3Message::getSize() const
}
-const bool POP3Message::isExpunged() const
+bool POP3Message::isExpunged() const
{
return (false);
}
-const int POP3Message::getFlags() const
+int POP3Message::getFlags() const
{
int flags = FLAG_RECENT;
diff --git a/src/net/pop3/POP3Store.cpp b/src/net/pop3/POP3Store.cpp
index 08f3c40b..16a5dff4 100644
--- a/src/net/pop3/POP3Store.cpp
+++ b/src/net/pop3/POP3Store.cpp
@@ -119,7 +119,7 @@ ref <folder> POP3Store::getFolder(const folder::path& path)
}
-const bool POP3Store::isValidFolderName(const folder::path::component& /* name */) const
+bool POP3Store::isValidFolderName(const folder::path::component& /* name */) const
{
return true;
}
@@ -572,13 +572,13 @@ void POP3Store::startTLS()
#endif // VMIME_HAVE_TLS_SUPPORT
-const bool POP3Store::isConnected() const
+bool POP3Store::isConnected() const
{
return (m_socket && m_socket->isConnected() && m_authentified);
}
-const bool POP3Store::isSecuredConnection() const
+bool POP3Store::isSecuredConnection() const
{
return m_secured;
}
@@ -666,13 +666,13 @@ const std::vector <string> POP3Store::getCapabilities()
}
-const bool POP3Store::isSuccessResponse(const string& buffer)
+bool POP3Store::isSuccessResponse(const string& buffer)
{
return getResponseCode(buffer) == RESPONSE_OK;
}
-const bool POP3Store::stripFirstLine(const string& buffer, string& result, string* firstLine)
+bool POP3Store::stripFirstLine(const string& buffer, string& result, string* firstLine)
{
const string::size_type end = buffer.find('\n');
@@ -690,7 +690,7 @@ const bool POP3Store::stripFirstLine(const string& buffer, string& result, strin
}
-const int POP3Store::getResponseCode(const string& buffer)
+int POP3Store::getResponseCode(const string& buffer)
{
if (buffer.length() >= 2)
{
@@ -805,7 +805,7 @@ void POP3Store::readResponse(string& buffer, const bool multiLine,
}
last1 = receiveBuffer[receiveBuffer.length() - 1];
- last2 = (receiveBuffer.length() >= 2) ? receiveBuffer[receiveBuffer.length() - 2] : 0;
+ last2 = static_cast <char>((receiveBuffer.length() >= 2) ? receiveBuffer[receiveBuffer.length() - 2] : 0);
// Append the data to the response buffer
buffer += receiveBuffer;
@@ -926,7 +926,7 @@ void POP3Store::readResponse(utility::outputStream& os,
}
-const bool POP3Store::checkTerminator(string& buffer, const bool multiLine)
+bool POP3Store::checkTerminator(string& buffer, const bool multiLine)
{
// Multi-line response
if (multiLine)
@@ -951,7 +951,7 @@ const bool POP3Store::checkTerminator(string& buffer, const bool multiLine)
}
-const bool POP3Store::checkOneTerminator(string& buffer, const string& term)
+bool POP3Store::checkOneTerminator(string& buffer, const string& term)
{
if (buffer.length() >= term.length() &&
std::equal(buffer.end() - term.length(), buffer.end(), term.begin()))
@@ -977,7 +977,7 @@ void POP3Store::unregisterFolder(POP3Folder* folder)
}
-const int POP3Store::getCapabilities() const
+int POP3Store::getCapabilities() const
{
return (CAPABILITY_DELETE_MESSAGE);
}
diff --git a/src/net/sendmail/sendmailTransport.cpp b/src/net/sendmail/sendmailTransport.cpp
index fdd6e9ba..c1aded62 100644
--- a/src/net/sendmail/sendmailTransport.cpp
+++ b/src/net/sendmail/sendmailTransport.cpp
@@ -92,13 +92,13 @@ void sendmailTransport::connect()
}
-const bool sendmailTransport::isConnected() const
+bool sendmailTransport::isConnected() const
{
return (m_connected);
}
-const bool sendmailTransport::isSecuredConnection() const
+bool sendmailTransport::isSecuredConnection() const
{
return false;
}
@@ -106,7 +106,7 @@ const bool sendmailTransport::isSecuredConnection() const
ref <connectionInfos> sendmailTransport::getConnectionInfos() const
{
- return vmime::create <defaultConnectionInfos>("localhost", 0);
+ return vmime::create <defaultConnectionInfos>("localhost", static_cast <port_t>(0));
}
diff --git a/src/net/serviceFactory.cpp b/src/net/serviceFactory.cpp
index 49c6a50b..0abeeb39 100644
--- a/src/net/serviceFactory.cpp
+++ b/src/net/serviceFactory.cpp
@@ -100,7 +100,7 @@ ref <const serviceFactory::registeredService> serviceFactory::getServiceByProtoc
}
-const int serviceFactory::getServiceCount() const
+int serviceFactory::getServiceCount() const
{
return (m_services.size());
}
diff --git a/src/net/serviceInfos.cpp b/src/net/serviceInfos.cpp
index 01547a14..d6aee298 100644
--- a/src/net/serviceInfos.cpp
+++ b/src/net/serviceInfos.cpp
@@ -79,7 +79,7 @@ serviceInfos::~serviceInfos()
}
-const bool serviceInfos::hasProperty(ref <session> s, const property& p) const
+bool serviceInfos::hasProperty(ref <session> s, const property& p) const
{
return s->getProperties().hasProperty(getPropertyPrefix() + p.getName());
}
@@ -141,13 +141,13 @@ const string& serviceInfos::property::getDefaultValue() const
}
-const serviceInfos::property::Types serviceInfos::property::getType() const
+serviceInfos::property::Types serviceInfos::property::getType() const
{
return (m_type);
}
-const int serviceInfos::property::getFlags() const
+int serviceInfos::property::getFlags() const
{
return (m_flags);
}
diff --git a/src/net/serviceRegistration.inl b/src/net/serviceRegistration.inl
index 2d7f1888..75fa4358 100644
--- a/src/net/serviceRegistration.inl
+++ b/src/net/serviceRegistration.inl
@@ -58,7 +58,7 @@ public:
return (m_name);
}
- const int getType() const
+ int getType() const
{
return (m_type);
}
diff --git a/src/net/smtp/SMTPResponse.cpp b/src/net/smtp/SMTPResponse.cpp
index 17d5d0c9..24301c57 100644
--- a/src/net/smtp/SMTPResponse.cpp
+++ b/src/net/smtp/SMTPResponse.cpp
@@ -49,7 +49,7 @@ SMTPResponse::SMTPResponse(const SMTPResponse&)
}
-const int SMTPResponse::getCode() const
+int SMTPResponse::getCode() const
{
const int firstCode = m_lines[0].getCode();
@@ -179,7 +179,7 @@ const SMTPResponse::responseLine SMTPResponse::getNextResponse()
// static
-const int SMTPResponse::extractResponseCode(const string& response)
+int SMTPResponse::extractResponseCode(const string& response)
{
int code = 0;
@@ -200,7 +200,7 @@ const SMTPResponse::responseLine SMTPResponse::getLineAt(const unsigned int pos)
}
-const unsigned int SMTPResponse::getLineCount() const
+unsigned int SMTPResponse::getLineCount() const
{
return m_lines.size();
}
@@ -227,7 +227,7 @@ void SMTPResponse::responseLine::setCode(const int code)
}
-const int SMTPResponse::responseLine::getCode() const
+int SMTPResponse::responseLine::getCode() const
{
return m_code;
}
diff --git a/src/net/smtp/SMTPTransport.cpp b/src/net/smtp/SMTPTransport.cpp
index e042bafd..0a2e5b9f 100644
--- a/src/net/smtp/SMTPTransport.cpp
+++ b/src/net/smtp/SMTPTransport.cpp
@@ -485,13 +485,13 @@ void SMTPTransport::startTLS()
#endif // VMIME_HAVE_TLS_SUPPORT
-const bool SMTPTransport::isConnected() const
+bool SMTPTransport::isConnected() const
{
return (m_socket && m_socket->isConnected() && m_authentified);
}
-const bool SMTPTransport::isSecuredConnection() const
+bool SMTPTransport::isSecuredConnection() const
{
return m_secured;
}
diff --git a/src/net/tls/TLSSecuredConnectionInfos.cpp b/src/net/tls/TLSSecuredConnectionInfos.cpp
index 01938171..55df5e20 100644
--- a/src/net/tls/TLSSecuredConnectionInfos.cpp
+++ b/src/net/tls/TLSSecuredConnectionInfos.cpp
@@ -45,7 +45,7 @@ const string TLSSecuredConnectionInfos::getHost() const
}
-const port_t TLSSecuredConnectionInfos::getPort() const
+port_t TLSSecuredConnectionInfos::getPort() const
{
return m_port;
}
diff --git a/src/net/tls/TLSSocket.cpp b/src/net/tls/TLSSocket.cpp
index 65abb6d9..73af1da7 100644
--- a/src/net/tls/TLSSocket.cpp
+++ b/src/net/tls/TLSSocket.cpp
@@ -84,7 +84,7 @@ void TLSSocket::disconnect()
}
-const bool TLSSocket::isConnected() const
+bool TLSSocket::isConnected() const
{
return m_wrapped->isConnected() && m_connected;
}
@@ -103,7 +103,7 @@ void TLSSocket::send(const string& buffer)
}
-const int TLSSocket::receiveRaw(char* buffer, const int count)
+int TLSSocket::receiveRaw(char* buffer, const int count)
{
const ssize_t ret = gnutls_record_recv
(*m_session->m_gnutlsSession,
diff --git a/src/net/transport.cpp b/src/net/transport.cpp
index 3c8536ab..5db70d21 100644
--- a/src/net/transport.cpp
+++ b/src/net/transport.cpp
@@ -123,7 +123,7 @@ void transport::send(ref <vmime::message> msg, utility::progressListener* progre
}
-const transport::Type transport::getType() const
+transport::Type transport::getType() const
{
return (TYPE_TRANSPORT);
}
diff --git a/src/parameter.cpp b/src/parameter.cpp
index 0e2676f0..466df3d1 100644
--- a/src/parameter.cpp
+++ b/src/parameter.cpp
@@ -175,7 +175,7 @@ void parameter::parse(const std::vector <valueChunk>& chunks)
if (c == '%' && i + 2 < len)
{
- string::value_type v = 0;
+ unsigned int v = 0;
// First char
switch (chunk.data[i + 1])
@@ -209,7 +209,7 @@ void parameter::parse(const std::vector <valueChunk>& chunks)
break;
}
- value << v;
+ value << static_cast <string::value_type>(v);
i += 2; // skip next 2 chars
}
diff --git a/src/parameterizedHeaderField.cpp b/src/parameterizedHeaderField.cpp
index e4629b85..a45c6272 100644
--- a/src/parameterizedHeaderField.cpp
+++ b/src/parameterizedHeaderField.cpp
@@ -354,14 +354,14 @@ parameterizedHeaderField& parameterizedHeaderField::operator=(const parameterize
}
-const bool parameterizedHeaderField::hasParameter(const string& paramName) const
+bool parameterizedHeaderField::hasParameter(const string& paramName) const
{
const string name = utility::stringUtils::toLower(paramName);
std::vector <ref <parameter> >::const_iterator pos = m_params.begin();
const std::vector <ref <parameter> >::const_iterator end = m_params.end();
- for ( ; pos != end && utility::stringUtils::toLower((*pos)->getName()) != name ; ++pos);
+ for ( ; pos != end && utility::stringUtils::toLower((*pos)->getName()) != name ; ++pos) {}
return (pos != end);
}
@@ -375,7 +375,7 @@ ref <parameter> parameterizedHeaderField::findParameter(const string& paramName)
std::vector <ref <parameter> >::const_iterator pos = m_params.begin();
const std::vector <ref <parameter> >::const_iterator end = m_params.end();
- for ( ; pos != end && utility::stringUtils::toLower((*pos)->getName()) != name ; ++pos);
+ for ( ; pos != end && utility::stringUtils::toLower((*pos)->getName()) != name ; ++pos) {}
// No parameter with this name can be found
if (pos == end)
@@ -398,7 +398,7 @@ ref <parameter> parameterizedHeaderField::getParameter(const string& paramName)
std::vector <ref <parameter> >::const_iterator pos = m_params.begin();
const std::vector <ref <parameter> >::const_iterator end = m_params.end();
- for ( ; pos != end && utility::stringUtils::toLower((*pos)->getName()) != name ; ++pos);
+ for ( ; pos != end && utility::stringUtils::toLower((*pos)->getName()) != name ; ++pos) {}
// If no parameter with this name can be found, create a new one
if (pos == end)
@@ -486,13 +486,13 @@ void parameterizedHeaderField::removeAllParameters()
}
-const int parameterizedHeaderField::getParameterCount() const
+int parameterizedHeaderField::getParameterCount() const
{
return (m_params.size());
}
-const bool parameterizedHeaderField::isEmpty() const
+bool parameterizedHeaderField::isEmpty() const
{
return (m_params.empty());
}
diff --git a/src/path.cpp b/src/path.cpp
index 39c44613..58167875 100644
--- a/src/path.cpp
+++ b/src/path.cpp
@@ -70,14 +70,14 @@ void path::setDomain(const string& domain)
}
-const bool path::operator==(const path& p) const
+bool path::operator==(const path& p) const
{
return (m_localPart == p.m_localPart &&
m_domain == p.m_domain);
}
-const bool path::operator!=(const path& p) const
+bool path::operator!=(const path& p) const
{
return (m_localPart != p.m_localPart ||
m_domain != p.m_domain);
diff --git a/src/plainTextPart.cpp b/src/plainTextPart.cpp
index fa794d24..dee3f397 100644
--- a/src/plainTextPart.cpp
+++ b/src/plainTextPart.cpp
@@ -51,7 +51,7 @@ const mediaType plainTextPart::getType() const
}
-const int plainTextPart::getPartCount() const
+int plainTextPart::getPartCount() const
{
return (1);
}
diff --git a/src/platforms/posix/posixChildProcess.cpp b/src/platforms/posix/posixChildProcess.cpp
index 6765c705..d1a0d910 100644
--- a/src/platforms/posix/posixChildProcess.cpp
+++ b/src/platforms/posix/posixChildProcess.cpp
@@ -145,7 +145,7 @@ public:
{
}
- const bool eof() const
+ bool eof() const
{
return (m_eof);
}
@@ -155,7 +155,7 @@ public:
// Do nothing: unsupported
}
- const size_type skip(const size_type count)
+ size_type skip(const size_type count)
{
// TODO: not tested
value_type buffer[4096];
@@ -178,7 +178,7 @@ public:
return static_cast <size_type>(bytesSkipped);
}
- const size_type read(value_type* const data, const size_type count)
+ size_type read(value_type* const data, const size_type count)
{
int bytesRead = 0;
diff --git a/src/platforms/posix/posixFile.cpp b/src/platforms/posix/posixFile.cpp
index 1056155e..4d063d4e 100644
--- a/src/platforms/posix/posixFile.cpp
+++ b/src/platforms/posix/posixFile.cpp
@@ -66,7 +66,7 @@ posixFileIterator::~posixFileIterator()
}
-const bool posixFileIterator::hasMoreElements() const
+bool posixFileIterator::hasMoreElements() const
{
return (m_dirEntry != NULL);
}
@@ -146,7 +146,7 @@ posixFileReaderInputStream::~posixFileReaderInputStream()
}
-const bool posixFileReaderInputStream::eof() const
+bool posixFileReaderInputStream::eof() const
{
return (m_eof);
}
@@ -158,7 +158,7 @@ void posixFileReaderInputStream::reset()
}
-const vmime::utility::stream::size_type posixFileReaderInputStream::read
+vmime::utility::stream::size_type posixFileReaderInputStream::read
(value_type* const data, const size_type count)
{
ssize_t c = 0;
@@ -173,7 +173,7 @@ const vmime::utility::stream::size_type posixFileReaderInputStream::read
}
-const vmime::utility::stream::size_type posixFileReaderInputStream::skip(const size_type count)
+vmime::utility::stream::size_type posixFileReaderInputStream::skip(const size_type count)
{
const off_t curPos = ::lseek(m_fd, 0, SEEK_CUR);
const off_t newPos = ::lseek(m_fd, count, SEEK_CUR);
@@ -254,21 +254,21 @@ void posixFile::createDirectory(const bool createAll)
}
-const bool posixFile::isFile() const
+bool posixFile::isFile() const
{
struct stat buf;
return (::stat(m_nativePath.c_str(), &buf) == 0 && S_ISREG(buf.st_mode));
}
-const bool posixFile::isDirectory() const
+bool posixFile::isDirectory() const
{
struct stat buf;
return (::stat(m_nativePath.c_str(), &buf) == 0 && S_ISDIR(buf.st_mode));
}
-const bool posixFile::canRead() const
+bool posixFile::canRead() const
{
struct stat buf;
return (::stat(m_nativePath.c_str(), &buf) == 0 &&
@@ -277,7 +277,7 @@ const bool posixFile::canRead() const
}
-const bool posixFile::canWrite() const
+bool posixFile::canWrite() const
{
struct stat buf;
return (::stat(m_nativePath.c_str(), &buf) == 0 &&
@@ -286,7 +286,7 @@ const bool posixFile::canWrite() const
}
-const posixFile::length_type posixFile::getLength()
+posixFile::length_type posixFile::getLength()
{
struct stat buf;
@@ -303,7 +303,7 @@ const posixFile::path& posixFile::getFullPath() const
}
-const bool posixFile::exists() const
+bool posixFile::exists() const
{
struct stat buf;
return (::stat(m_nativePath.c_str(), &buf) == 0);
@@ -451,13 +451,13 @@ const vmime::string posixFileSystemFactory::pathToStringImpl(const vmime::utilit
}
-const bool posixFileSystemFactory::isValidPathComponent(const vmime::utility::file::path::component& comp) const
+bool posixFileSystemFactory::isValidPathComponent(const vmime::utility::file::path::component& comp) const
{
return (comp.getBuffer().find_first_of("/*") == vmime::string::npos);
}
-const bool posixFileSystemFactory::isValidPath(const vmime::utility::file::path& path) const
+bool posixFileSystemFactory::isValidPath(const vmime::utility::file::path& path) const
{
for (int i = 0 ; i < path.getSize() ; ++i)
{
diff --git a/src/platforms/posix/posixHandler.cpp b/src/platforms/posix/posixHandler.cpp
index d1b782f7..94a5072f 100644
--- a/src/platforms/posix/posixHandler.cpp
+++ b/src/platforms/posix/posixHandler.cpp
@@ -70,7 +70,7 @@ posixHandler::~posixHandler()
}
-const unsigned int posixHandler::getUnixTime() const
+unsigned int posixHandler::getUnixTime() const
{
return ::time(NULL);
}
@@ -165,7 +165,7 @@ const vmime::string posixHandler::getHostName() const
}
-const unsigned int posixHandler::getProcessId() const
+unsigned int posixHandler::getProcessId() const
{
return (::getpid());
}
diff --git a/src/platforms/posix/posixSocket.cpp b/src/platforms/posix/posixSocket.cpp
index fe650803..4c2375c6 100644
--- a/src/platforms/posix/posixSocket.cpp
+++ b/src/platforms/posix/posixSocket.cpp
@@ -194,7 +194,7 @@ void posixSocket::connect(const vmime::string& address, const vmime::port_t port
}
-const bool posixSocket::isConnected() const
+bool posixSocket::isConnected() const
{
if (m_desc == -1)
return false;
@@ -224,7 +224,7 @@ void posixSocket::receive(vmime::string& buffer)
}
-const int posixSocket::receiveRaw(char* buffer, const int count)
+int posixSocket::receiveRaw(char* buffer, const int count)
{
const int ret = ::recv(m_desc, buffer, count, 0);
diff --git a/src/platforms/windows/windowsFile.cpp b/src/platforms/windows/windowsFile.cpp
index 56cd842e..c94076c5 100644
--- a/src/platforms/windows/windowsFile.cpp
+++ b/src/platforms/windows/windowsFile.cpp
@@ -94,12 +94,12 @@ const vmime::string windowsFileSystemFactory::pathToStringImpl(const vmime::util
return (native);
}
-const bool windowsFileSystemFactory::isValidPathComponent(const vmime::utility::file::path::component& comp) const
+bool windowsFileSystemFactory::isValidPathComponent(const vmime::utility::file::path::component& comp) const
{
return isValidPathComponent(comp, false);
}
-const bool windowsFileSystemFactory::isValidPathComponent(
+bool windowsFileSystemFactory::isValidPathComponent(
const vmime::utility::file::path::component& comp,
bool firstComponent) const
{
@@ -159,7 +159,7 @@ const bool windowsFileSystemFactory::isValidPathComponent(
}
-const bool windowsFileSystemFactory::isValidPath(const vmime::utility::file::path& path) const
+bool windowsFileSystemFactory::isValidPath(const vmime::utility::file::path& path) const
{
for (int i = 0 ; i < path.getSize() ; ++i)
{
@@ -220,7 +220,7 @@ void windowsFile::createDirectory(const bool createAll)
createDirectoryImpl(m_path, m_path, createAll);
}
-const bool windowsFile::isFile() const
+bool windowsFile::isFile() const
{
DWORD dwFileAttribute = GetFileAttributes(m_nativePath.c_str());
if (dwFileAttribute == INVALID_FILE_ATTRIBUTES)
@@ -228,7 +228,7 @@ const bool windowsFile::isFile() const
return (dwFileAttribute & FILE_ATTRIBUTE_DIRECTORY) == 0;
}
-const bool windowsFile::isDirectory() const
+bool windowsFile::isDirectory() const
{
DWORD dwFileAttribute = GetFileAttributes(m_nativePath.c_str());
if (dwFileAttribute == INVALID_FILE_ATTRIBUTES)
@@ -236,7 +236,7 @@ const bool windowsFile::isDirectory() const
return (dwFileAttribute & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY;
}
-const bool windowsFile::canRead() const
+bool windowsFile::canRead() const
{
HANDLE hFile = CreateFile(
m_nativePath.c_str(),
@@ -252,7 +252,7 @@ const bool windowsFile::canRead() const
return true;
}
-const bool windowsFile::canWrite() const
+bool windowsFile::canWrite() const
{
HANDLE hFile = CreateFile(
m_nativePath.c_str(),
@@ -292,7 +292,7 @@ const vmime::utility::path& windowsFile::getFullPath() const
return m_path;
}
-const bool windowsFile::exists() const
+bool windowsFile::exists() const
{
WIN32_FIND_DATA findData;
HANDLE hFind = FindFirstFile(m_nativePath.c_str(), &findData);
@@ -372,7 +372,7 @@ windowsFileIterator::~windowsFileIterator()
FindClose(m_hFind);
}
-const bool windowsFileIterator::hasMoreElements() const
+bool windowsFileIterator::hasMoreElements() const
{
return m_moreElements;
}
@@ -452,7 +452,7 @@ windowsFileReaderInputStream::~windowsFileReaderInputStream()
CloseHandle(m_hFile);
}
-const bool windowsFileReaderInputStream::eof() const
+bool windowsFileReaderInputStream::eof() const
{
DWORD dwSize = GetFileSize(m_hFile, NULL);
DWORD dwPosition = SetFilePointer(m_hFile, 0, NULL, FILE_CURRENT);
diff --git a/src/platforms/windows/windowsHandler.cpp b/src/platforms/windows/windowsHandler.cpp
index 0aeb9c91..58b1ae9c 100644
--- a/src/platforms/windows/windowsHandler.cpp
+++ b/src/platforms/windows/windowsHandler.cpp
@@ -64,7 +64,7 @@ windowsHandler::~windowsHandler()
}
-const unsigned int windowsHandler::getUnixTime() const
+unsigned int windowsHandler::getUnixTime() const
{
return static_cast <unsigned int>(::time(NULL));
}
@@ -232,7 +232,7 @@ const vmime::string windowsHandler::getHostName() const
}
-const unsigned int windowsHandler::getProcessId() const
+unsigned int windowsHandler::getProcessId() const
{
return (static_cast <unsigned int>(::GetCurrentProcessId()));
}
diff --git a/src/platforms/windows/windowsSocket.cpp b/src/platforms/windows/windowsSocket.cpp
index feb4dda4..9450efc6 100644
--- a/src/platforms/windows/windowsSocket.cpp
+++ b/src/platforms/windows/windowsSocket.cpp
@@ -103,7 +103,7 @@ void windowsSocket::connect(const vmime::string& address, const vmime::port_t po
}
-const bool windowsSocket::isConnected() const
+bool windowsSocket::isConnected() const
{
return (m_desc != -1);
}
@@ -137,7 +137,7 @@ void windowsSocket::receive(vmime::string& buffer)
}
-const int windowsSocket::receiveRaw(char* buffer, const int count)
+int windowsSocket::receiveRaw(char* buffer, const int count)
{
int ret = ::recv(m_desc, buffer, count, 0);
diff --git a/src/propertySet.cpp b/src/propertySet.cpp
index 437468e7..c980d96d 100644
--- a/src/propertySet.cpp
+++ b/src/propertySet.cpp
@@ -95,7 +95,7 @@ void propertySet::parse(const string& props)
for ( ; pos != end ; )
{
// Skip white-spaces
- for ( ; pos != end && parserHelpers::isSpace(*pos) ; ++pos);
+ for ( ; pos != end && parserHelpers::isSpace(*pos) ; ++pos) {}
if (pos != end)
{
@@ -108,11 +108,11 @@ void propertySet::parse(const string& props)
// Extract the property name
const string::const_iterator optStart = pos;
- for ( ; pos != end && *pos != '=' ; ++pos);
+ for ( ; pos != end && *pos != '=' ; ++pos) {}
string::const_iterator optEnd = pos;
- for ( ; optEnd != optStart && parserHelpers::isSpace(*(optEnd - 1)) ; --optEnd);
+ for ( ; optEnd != optStart && parserHelpers::isSpace(*(optEnd - 1)) ; --optEnd) {}
const string option(optStart, optEnd);
string value = "1";
@@ -122,7 +122,7 @@ void propertySet::parse(const string& props)
++pos; // skip '='
// Extract the value
- for ( ; pos != end && parserHelpers::isSpace(*pos) ; ++pos);
+ for ( ; pos != end && parserHelpers::isSpace(*pos) ; ++pos) {}
if (pos != end)
{
@@ -161,13 +161,13 @@ void propertySet::parse(const string& props)
{
const string::const_iterator valStart = pos;
- for ( ; pos != end && !parserHelpers::isSpace(*pos) ; ++pos);
+ for ( ; pos != end && !parserHelpers::isSpace(*pos) ; ++pos) {}
value = string(valStart, pos);
}
// Advance to the next ';'
- for ( ; pos != end && (*pos != ';') ; ++pos);
+ for ( ; pos != end && (*pos != ';') ; ++pos) {}
if (pos != end)
++pos; // skip ';'
@@ -219,7 +219,7 @@ const propertySet::constPropertyProxy propertySet::operator[](const string& name
}
-const bool propertySet::hasProperty(const string& name) const
+bool propertySet::hasProperty(const string& name) const
{
return (find(name) != NULL);
}
@@ -304,14 +304,14 @@ void propertySet::property::setValue(const bool& value)
template <>
-const string propertySet::property::getValue() const
+string propertySet::property::getValue() const
{
return (m_value);
}
template <>
-const bool propertySet::property::getValue() const
+bool propertySet::property::getValue() const
{
if (utility::stringUtils::toLower(m_value) == "true")
return true;
@@ -332,21 +332,21 @@ const bool propertySet::property::getValue() const
template <>
-const string propertySet::valueFromString(const string& value)
+string propertySet::valueFromString(const string& value)
{
return value;
}
template <>
-const string propertySet::valueToString(const string& value)
+string propertySet::valueToString(const string& value)
{
return value;
}
template <>
-const bool propertySet::valueFromString(const string& value)
+bool propertySet::valueFromString(const string& value)
{
if (utility::stringUtils::toLower(value) == "true")
return true;
@@ -365,7 +365,7 @@ const bool propertySet::valueFromString(const string& value)
template <>
-const string propertySet::valueToString(const bool& value)
+string propertySet::valueToString(const bool& value)
{
return (value ? "true" : "false");
}
diff --git a/src/relay.cpp b/src/relay.cpp
index 430bc204..b86ea143 100644
--- a/src/relay.cpp
+++ b/src/relay.cpp
@@ -100,7 +100,7 @@ void relay::parse(const string& buffer, const string::size_type position,
{
Parts newPart = Part_None;
- if (cont = ((iss >> word) != 0))
+ if ((cont = ((iss >> word) != 0)))
{
// A little hack for handling comments
if (inComment)
diff --git a/src/security/cert/X509Certificate.cpp b/src/security/cert/X509Certificate.cpp
index be8f0f4e..ac1f7e04 100644
--- a/src/security/cert/X509Certificate.cpp
+++ b/src/security/cert/X509Certificate.cpp
@@ -147,15 +147,14 @@ const byteArray X509Certificate::getSerialNumber() const
}
-const bool X509Certificate::checkIssuer
- (ref <const X509Certificate> issuer) const
+bool X509Certificate::checkIssuer(ref <const X509Certificate> issuer) const
{
return (gnutls_x509_crt_check_issuer
(m_data->cert, issuer->m_data->cert) >= 1);
}
-const bool X509Certificate::verify(ref <const X509Certificate> caCert) const
+bool X509Certificate::verify(ref <const X509Certificate> caCert) const
{
unsigned int verify = 0;
@@ -236,13 +235,13 @@ const string X509Certificate::getType() const
}
-const int X509Certificate::getVersion() const
+int X509Certificate::getVersion() const
{
return gnutls_x509_crt_get_version(m_data->cert);
}
-const bool X509Certificate::equals(ref <const certificate> other) const
+bool X509Certificate::equals(ref <const certificate> other) const
{
ref <const X509Certificate> otherX509 =
other.dynamicCast <const X509Certificate>();
diff --git a/src/security/cert/certificateChain.cpp b/src/security/cert/certificateChain.cpp
index b2e2a065..0425d003 100644
--- a/src/security/cert/certificateChain.cpp
+++ b/src/security/cert/certificateChain.cpp
@@ -35,7 +35,7 @@ certificateChain::certificateChain(const std::vector <ref <certificate> >& certs
}
-const unsigned int certificateChain::getCount() const
+unsigned int certificateChain::getCount() const
{
return static_cast <unsigned int>(m_certs.size());
}
diff --git a/src/security/digest/md5/md5MessageDigest.cpp b/src/security/digest/md5/md5MessageDigest.cpp
index ac3773d5..d83908fe 100644
--- a/src/security/digest/md5/md5MessageDigest.cpp
+++ b/src/security/digest/md5/md5MessageDigest.cpp
@@ -50,6 +50,8 @@
#include "vmime/security/digest/md5/md5MessageDigest.hpp"
+#include <cstring>
+
namespace vmime {
namespace security {
@@ -327,7 +329,7 @@ void md5MessageDigest::transform()
}
-const int md5MessageDigest::getDigestLength() const
+int md5MessageDigest::getDigestLength() const
{
return 16;
}
diff --git a/src/security/digest/sha1/sha1MessageDigest.cpp b/src/security/digest/sha1/sha1MessageDigest.cpp
index b86cb996..a51e250d 100644
--- a/src/security/digest/sha1/sha1MessageDigest.cpp
+++ b/src/security/digest/sha1/sha1MessageDigest.cpp
@@ -26,6 +26,8 @@
#include "vmime/security/digest/sha1/sha1MessageDigest.hpp"
+#include <cstring>
+
namespace vmime {
namespace security {
@@ -126,7 +128,7 @@ void sha1MessageDigest::update(const byte_t* buffer, const unsigned long len)
i = 0;
}
- memcpy(&m_buffer[j], &buffer[i], len - i);
+ std::memcpy(&m_buffer[j], &buffer[i], len - i);
}
@@ -158,10 +160,10 @@ void sha1MessageDigest::finalize()
// Wipe variables
i = j = 0;
- memset(m_buffer, 0, 64);
- memset(m_state, 0, 20);
- memset(m_count, 0, 8);
- memset(&finalcount, 0, 8);
+ std::memset(m_buffer, 0, 64);
+ std::memset(m_state, 0, 20);
+ std::memset(m_count, 0, 8);
+ std::memset(&finalcount, 0, 8);
}
@@ -246,7 +248,7 @@ void sha1MessageDigest::transform
}
-const int sha1MessageDigest::getDigestLength() const
+int sha1MessageDigest::getDigestLength() const
{
return 20;
}
diff --git a/src/security/sasl/SASLMechanismFactory.cpp b/src/security/sasl/SASLMechanismFactory.cpp
index 37858199..a866e0cf 100644
--- a/src/security/sasl/SASLMechanismFactory.cpp
+++ b/src/security/sasl/SASLMechanismFactory.cpp
@@ -115,14 +115,14 @@ const std::vector <string> SASLMechanismFactory::getSupportedMechanisms() const
}
}
- free(out);
+ gsasl_free(out);
}
return list;
}
-const bool SASLMechanismFactory::isMechanismSupported(const string& name) const
+bool SASLMechanismFactory::isMechanismSupported(const string& name) const
{
return (gsasl_client_support_p(m_gsaslContext, name.c_str()) != 0 ||
m_mechs.find(name) != m_mechs.end());
diff --git a/src/security/sasl/SASLSession.cpp b/src/security/sasl/SASLSession.cpp
index 01da8ee9..f7f80f59 100644
--- a/src/security/sasl/SASLSession.cpp
+++ b/src/security/sasl/SASLSession.cpp
@@ -92,7 +92,7 @@ ref <SASLContext> SASLSession::getContext()
}
-const bool SASLSession::evaluateChallenge
+bool SASLSession::evaluateChallenge
(const byte_t* challenge, const int challengeLen,
byte_t** response, int* responseLen)
{
diff --git a/src/security/sasl/SASLSocket.cpp b/src/security/sasl/SASLSocket.cpp
index 50c31e1b..5f86aed5 100644
--- a/src/security/sasl/SASLSocket.cpp
+++ b/src/security/sasl/SASLSocket.cpp
@@ -63,7 +63,7 @@ void SASLSocket::disconnect()
}
-const bool SASLSocket::isConnected() const
+bool SASLSocket::isConnected() const
{
return m_wrapped->isConnected();
}
@@ -77,7 +77,7 @@ void SASLSocket::receive(string& buffer)
}
-const int SASLSocket::receiveRaw(char* buffer, const int count)
+int SASLSocket::receiveRaw(char* buffer, const int count)
{
if (m_pendingLen != 0)
{
diff --git a/src/security/sasl/builtinSASLMechanism.cpp b/src/security/sasl/builtinSASLMechanism.cpp
index 168b34cb..1c958311 100644
--- a/src/security/sasl/builtinSASLMechanism.cpp
+++ b/src/security/sasl/builtinSASLMechanism.cpp
@@ -56,7 +56,7 @@ const string builtinSASLMechanism::getName() const
}
-const bool builtinSASLMechanism::step
+bool builtinSASLMechanism::step
(ref <SASLSession> sess, const byte_t* challenge, const int challengeLen,
byte_t** response, int* responseLen)
{
@@ -77,7 +77,7 @@ const bool builtinSASLMechanism::step
*response = res;
*responseLen = outputLen;
- free(output);
+ gsasl_free(output);
}
else
{
@@ -108,7 +108,7 @@ const bool builtinSASLMechanism::step
}
-const bool builtinSASLMechanism::isComplete() const
+bool builtinSASLMechanism::isComplete() const
{
return m_complete;
}
@@ -139,11 +139,11 @@ void builtinSASLMechanism::encode
}
catch (...)
{
- free(coutput);
+ gsasl_free(coutput);
throw;
}
- free(coutput);
+ gsasl_free(coutput);
}
@@ -172,11 +172,11 @@ void builtinSASLMechanism::decode
}
catch (...)
{
- free(coutput);
+ gsasl_free(coutput);
throw;
}
- free(coutput);
+ gsasl_free(coutput);
}
diff --git a/src/streamContentHandler.cpp b/src/streamContentHandler.cpp
index 8fe2ba14..386b0e17 100644
--- a/src/streamContentHandler.cpp
+++ b/src/streamContentHandler.cpp
@@ -177,19 +177,19 @@ void streamContentHandler::extractRaw(utility::outputStream& os,
}
-const string::size_type streamContentHandler::getLength() const
+string::size_type streamContentHandler::getLength() const
{
return (m_length);
}
-const bool streamContentHandler::isEmpty() const
+bool streamContentHandler::isEmpty() const
{
return (m_length == 0 || !m_stream);
}
-const bool streamContentHandler::isEncoded() const
+bool streamContentHandler::isEncoded() const
{
return (m_encoding != NO_ENCODING);
}
diff --git a/src/stringContentHandler.cpp b/src/stringContentHandler.cpp
index ad5f178c..6dd2719b 100644
--- a/src/stringContentHandler.cpp
+++ b/src/stringContentHandler.cpp
@@ -178,19 +178,19 @@ void stringContentHandler::extractRaw(utility::outputStream& os,
}
-const string::size_type stringContentHandler::getLength() const
+string::size_type stringContentHandler::getLength() const
{
return (m_string.length());
}
-const bool stringContentHandler::isEmpty() const
+bool stringContentHandler::isEmpty() const
{
return (m_string.length() == 0);
}
-const bool stringContentHandler::isEncoded() const
+bool stringContentHandler::isEncoded() const
{
return (m_encoding != NO_ENCODING);
}
diff --git a/src/text.cpp b/src/text.cpp
index 13a682ef..2c811c42 100644
--- a/src/text.cpp
+++ b/src/text.cpp
@@ -131,7 +131,7 @@ text& text::operator=(const text& other)
}
-const bool text::operator==(const text& t) const
+bool text::operator==(const text& t) const
{
if (getWordCount() == t.getWordCount())
{
@@ -150,7 +150,7 @@ const bool text::operator==(const text& t) const
}
-const bool text::operator!=(const text& t) const
+bool text::operator!=(const text& t) const
{
return !(*this == t);
}
@@ -199,13 +199,13 @@ void text::removeAllWords()
}
-const int text::getWordCount() const
+int text::getWordCount() const
{
return (m_words.size());
}
-const bool text::isEmpty() const
+bool text::isEmpty() const
{
return (m_words.empty());
}
diff --git a/src/utility/datetimeUtils.cpp b/src/utility/datetimeUtils.cpp
index 0a59d858..ed9fb4bf 100644
--- a/src/utility/datetimeUtils.cpp
+++ b/src/utility/datetimeUtils.cpp
@@ -206,14 +206,14 @@ const datetime datetimeUtils::toLocalTime(const datetime& date, const int zone)
}
-const bool datetimeUtils::isLeapYear(const int year)
+bool datetimeUtils::isLeapYear(const int year)
{
// From RFC 3339 - Appendix C. Leap Years:
return ((year % 4) == 0 && (year % 100 != 0 || year % 400 == 0));
}
-const int datetimeUtils::getDaysInMonth(const int year, const int month)
+int datetimeUtils::getDaysInMonth(const int year, const int month)
{
static const int daysInMonth[12] =
{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
@@ -227,7 +227,7 @@ const int datetimeUtils::getDaysInMonth(const int year, const int month)
}
-const int datetimeUtils::getDayOfWeek(const int year, const int month, const int day)
+int datetimeUtils::getDayOfWeek(const int year, const int month, const int day)
{
int y = year;
int m = month;
@@ -256,7 +256,7 @@ const int datetimeUtils::getDayOfWeek(const int year, const int month, const int
}
-const int datetimeUtils::getWeekOfYear(const int year, const int month, const int day)
+int datetimeUtils::getWeekOfYear(const int year, const int month, const int day)
{
// Algorithm from http://personal.ecu.edu/mccartyr/ISOwdALG.txt
diff --git a/src/utility/filteredStream.cpp b/src/utility/filteredStream.cpp
index 74f6a1e8..eda0c64c 100644
--- a/src/utility/filteredStream.cpp
+++ b/src/utility/filteredStream.cpp
@@ -44,7 +44,7 @@ inputStream& dotFilteredInputStream::getPreviousInputStream()
}
-const bool dotFilteredInputStream::eof() const
+bool dotFilteredInputStream::eof() const
{
return (m_stream.eof());
}
@@ -59,7 +59,7 @@ void dotFilteredInputStream::reset()
}
-const stream::size_type dotFilteredInputStream::read(value_type* const data, const size_type count)
+stream::size_type dotFilteredInputStream::read(value_type* const data, const size_type count)
{
const stream::size_type read = m_stream.read(data, count);
@@ -111,7 +111,7 @@ const stream::size_type dotFilteredInputStream::read(value_type* const data, con
}
-const stream::size_type dotFilteredInputStream::skip(const size_type /* count */)
+stream::size_type dotFilteredInputStream::skip(const size_type /* count */)
{
// Skipping bytes is not supported
return 0;
@@ -250,7 +250,7 @@ void CRLFToLFFilteredOutputStream::flush()
// stopSequenceFilteredInputStream <1>
template <>
-const stream::size_type stopSequenceFilteredInputStream <1>::read
+stream::size_type stopSequenceFilteredInputStream <1>::read
(value_type* const data, const size_type count)
{
if (eof() || m_stream.eof())
diff --git a/src/utility/path.cpp b/src/utility/path.cpp
index eac1e6b1..053e612c 100644
--- a/src/utility/path.cpp
+++ b/src/utility/path.cpp
@@ -123,7 +123,7 @@ path& path::operator=(const component& c)
}
-const bool path::operator==(const path& p) const
+bool path::operator==(const path& p) const
{
if (m_list.size() != p.m_list.size())
return (false);
@@ -141,19 +141,19 @@ const bool path::operator==(const path& p) const
}
-const bool path::operator!=(const path& p) const
+bool path::operator!=(const path& p) const
{
return (!(*this == p));
}
-const bool path::isEmpty() const
+bool path::isEmpty() const
{
return (m_list.empty());
}
-const bool path::isRoot() const
+bool path::isRoot() const
{
return (m_list.empty());
}
@@ -171,7 +171,7 @@ path::component& path::getLastComponent()
}
-const int path::getSize() const
+int path::getSize() const
{
return (m_list.size());
}
@@ -189,7 +189,7 @@ path::component& path::operator[](const int x)
}
-const bool path::isDirectParentOf(const path& p) const
+bool path::isDirectParentOf(const path& p) const
{
if (p.getSize() != getSize() + 1)
return (false);
@@ -203,7 +203,7 @@ const bool path::isDirectParentOf(const path& p) const
}
-const bool path::isParentOf(const path& p) const
+bool path::isParentOf(const path& p) const
{
if (p.getSize() < getSize() + 1)
return (false);
diff --git a/src/utility/progressListener.cpp b/src/utility/progressListener.cpp
index 5d3b7834..c7babcbb 100644
--- a/src/utility/progressListener.cpp
+++ b/src/utility/progressListener.cpp
@@ -37,7 +37,7 @@ progressListenerSizeAdapter::progressListenerSizeAdapter
}
-const bool progressListenerSizeAdapter::cancel() const
+bool progressListenerSizeAdapter::cancel() const
{
return (m_wrapped ? m_wrapped->cancel() : false);
}
diff --git a/src/utility/random.cpp b/src/utility/random.cpp
index 41a94f81..2e373bb3 100644
--- a/src/utility/random.cpp
+++ b/src/utility/random.cpp
@@ -34,7 +34,7 @@ namespace utility {
unsigned int random::m_next(static_cast<unsigned int>(::std::time(NULL)));
-const unsigned int random::getNext()
+unsigned int random::getNext()
{
// Park and Miller's minimal standard generator:
// xn+1 = (a * xn + b) mod c
@@ -44,13 +44,13 @@ const unsigned int random::getNext()
}
-const unsigned int random::getTime()
+unsigned int random::getTime()
{
return (platform::getHandler()->getUnixTime());
}
-const unsigned int random::getProcess()
+unsigned int random::getProcess()
{
return (platform::getHandler()->getProcessId());
}
diff --git a/src/utility/smartPtrInt.cpp b/src/utility/smartPtrInt.cpp
index 9bebe977..4b4ce130 100644
--- a/src/utility/smartPtrInt.cpp
+++ b/src/utility/smartPtrInt.cpp
@@ -57,7 +57,7 @@ refManagerImpl::~refManagerImpl()
}
-const bool refManagerImpl::addStrong()
+bool refManagerImpl::addStrong()
{
if (m_strongCount <= 0)
return false;
@@ -118,13 +118,13 @@ void refManagerImpl::deleteObject()
}
-const long refManagerImpl::getStrongRefCount() const
+long refManagerImpl::getStrongRefCount() const
{
return m_strongCount;
}
-const long refManagerImpl::getWeakRefCount() const
+long refManagerImpl::getWeakRefCount() const
{
return m_weakCount;
}
@@ -149,13 +149,13 @@ refCounter::~refCounter()
}
-const long refCounter::increment()
+long refCounter::increment()
{
return InterlockedIncrement(&m_value);
}
-const long refCounter::decrement()
+long refCounter::decrement()
{
return InterlockedDecrement(&m_value);
}
@@ -181,7 +181,7 @@ refCounter::~refCounter()
}
-const long refCounter::increment()
+long refCounter::increment()
{
#if __GNUC_MINOR__ < 4 && __GNUC__ < 4
return __exchange_and_add(&m_value, 1) + 1;
@@ -191,7 +191,7 @@ const long refCounter::increment()
}
-const long refCounter::decrement()
+long refCounter::decrement()
{
#if __GNUC_MINOR__ < 4 && __GNUC__ < 4
return __exchange_and_add(&m_value, -1) - 1;
@@ -231,7 +231,7 @@ refCounter::~refCounter()
}
-const long refCounter::increment()
+long refCounter::increment()
{
long value;
@@ -243,7 +243,7 @@ const long refCounter::increment()
}
-const long refCounter::decrement()
+long refCounter::decrement()
{
long value;
@@ -275,13 +275,13 @@ refCounter::~refCounter()
}
-const long refCounter::increment()
+long refCounter::increment()
{
return ++m_value;
}
-const long refCounter::decrement()
+long refCounter::decrement()
{
return --m_value;
}
diff --git a/src/utility/stream.cpp b/src/utility/stream.cpp
index 9b402e6a..bb5300ef 100644
--- a/src/utility/stream.cpp
+++ b/src/utility/stream.cpp
@@ -38,7 +38,7 @@ namespace utility {
// stream
-const stream::size_type stream::getBlockSize() const
+stream::size_type stream::getBlockSize() const
{
return 32768; // 32 KB
}
@@ -60,13 +60,13 @@ outputStream& operator<<(outputStream& os, const string& str)
}
-const stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os)
+stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os)
{
return bufferedStreamCopy(is, os, 0, NULL);
}
-const stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os,
+stream::size_type bufferedStreamCopy(inputStream& is, outputStream& os,
const stream::size_type length, progressListener* progress)
{
const stream::size_type blockSize =
@@ -176,7 +176,7 @@ inputStreamAdapter::inputStreamAdapter(std::istream& is)
}
-const bool inputStreamAdapter::eof() const
+bool inputStreamAdapter::eof() const
{
return (m_stream.eof());
}
@@ -190,7 +190,7 @@ void inputStreamAdapter::reset()
}
-const stream::size_type inputStreamAdapter::read
+stream::size_type inputStreamAdapter::read
(value_type* const data, const size_type count)
{
m_stream.exceptions(std::ios_base::badbit);
@@ -199,7 +199,7 @@ const stream::size_type inputStreamAdapter::read
}
-const stream::size_type inputStreamAdapter::skip(const size_type count)
+stream::size_type inputStreamAdapter::skip(const size_type count)
{
m_stream.exceptions(std::ios_base::badbit);
m_stream.ignore(count);
@@ -223,7 +223,7 @@ inputStreamStringAdapter::inputStreamStringAdapter(const string& buffer,
}
-const bool inputStreamStringAdapter::eof() const
+bool inputStreamStringAdapter::eof() const
{
return (m_pos >= m_end);
}
@@ -235,7 +235,7 @@ void inputStreamStringAdapter::reset()
}
-const stream::size_type inputStreamStringAdapter::read
+stream::size_type inputStreamStringAdapter::read
(value_type* const data, const size_type count)
{
if (m_pos + count >= m_end)
@@ -255,7 +255,7 @@ const stream::size_type inputStreamStringAdapter::read
}
-const stream::size_type inputStreamStringAdapter::skip(const size_type count)
+stream::size_type inputStreamStringAdapter::skip(const size_type count)
{
if (m_pos + count >= m_end)
{
@@ -280,7 +280,7 @@ inputStreamStringProxyAdapter::inputStreamStringProxyAdapter(const stringProxy&
}
-const bool inputStreamStringProxyAdapter::eof() const
+bool inputStreamStringProxyAdapter::eof() const
{
return (m_pos >= m_buffer.length());
}
@@ -292,7 +292,7 @@ void inputStreamStringProxyAdapter::reset()
}
-const stream::size_type inputStreamStringProxyAdapter::read
+stream::size_type inputStreamStringProxyAdapter::read
(value_type* const data, const size_type count)
{
const size_type remaining = m_buffer.length() - m_pos;
@@ -312,7 +312,7 @@ const stream::size_type inputStreamStringProxyAdapter::read
}
-const stream::size_type inputStreamStringProxyAdapter::skip(const size_type count)
+stream::size_type inputStreamStringProxyAdapter::skip(const size_type count)
{
const size_type remaining = m_buffer.length() - m_pos;
@@ -352,7 +352,7 @@ inputStreamPointerAdapter::~inputStreamPointerAdapter()
}
-const bool inputStreamPointerAdapter::eof() const
+bool inputStreamPointerAdapter::eof() const
{
return (m_stream->eof());
}
@@ -366,7 +366,7 @@ void inputStreamPointerAdapter::reset()
}
-const stream::size_type inputStreamPointerAdapter::read
+stream::size_type inputStreamPointerAdapter::read
(value_type* const data, const size_type count)
{
m_stream->exceptions(std::ios_base::badbit);
@@ -375,7 +375,7 @@ const stream::size_type inputStreamPointerAdapter::read
}
-const stream::size_type inputStreamPointerAdapter::skip(const size_type count)
+stream::size_type inputStreamPointerAdapter::skip(const size_type count)
{
m_stream->exceptions(std::ios_base::badbit);
m_stream->ignore(count);
@@ -392,7 +392,7 @@ inputStreamByteBufferAdapter::inputStreamByteBufferAdapter(const byte_t* buffer,
}
-const bool inputStreamByteBufferAdapter::eof() const
+bool inputStreamByteBufferAdapter::eof() const
{
return m_pos >= m_length;
}
@@ -404,7 +404,7 @@ void inputStreamByteBufferAdapter::reset()
}
-const stream::size_type inputStreamByteBufferAdapter::read
+stream::size_type inputStreamByteBufferAdapter::read
(value_type* const data, const size_type count)
{
const size_type remaining = m_length - m_pos;
@@ -426,7 +426,7 @@ const stream::size_type inputStreamByteBufferAdapter::read
}
-const stream::size_type inputStreamByteBufferAdapter::skip(const size_type count)
+stream::size_type inputStreamByteBufferAdapter::skip(const size_type count)
{
const size_type remaining = m_length - m_pos;
@@ -468,7 +468,7 @@ void outputStreamSocketAdapter::flush()
}
-const stream::size_type outputStreamSocketAdapter::getBlockSize() const
+stream::size_type outputStreamSocketAdapter::getBlockSize() const
{
return 16384; // 16 KB
}
@@ -483,7 +483,7 @@ inputStreamSocketAdapter::inputStreamSocketAdapter(net::socket& sok)
}
-const bool inputStreamSocketAdapter::eof() const
+bool inputStreamSocketAdapter::eof() const
{
// Can't know...
return false;
@@ -496,14 +496,14 @@ void inputStreamSocketAdapter::reset()
}
-const stream::size_type inputStreamSocketAdapter::read
+stream::size_type inputStreamSocketAdapter::read
(value_type* const data, const size_type count)
{
return m_socket.receiveRaw(data, count);
}
-const stream::size_type inputStreamSocketAdapter::skip
+stream::size_type inputStreamSocketAdapter::skip
(const size_type /* count */)
{
// Not supported
@@ -511,7 +511,7 @@ const stream::size_type inputStreamSocketAdapter::skip
}
-const stream::size_type inputStreamSocketAdapter::getBlockSize() const
+stream::size_type inputStreamSocketAdapter::getBlockSize() const
{
return 16384; // 16 KB
}
diff --git a/src/utility/stringProxy.cpp b/src/utility/stringProxy.cpp
index 7984d7f8..60093b60 100644
--- a/src/utility/stringProxy.cpp
+++ b/src/utility/stringProxy.cpp
@@ -112,19 +112,19 @@ void stringProxy::extract(outputStream& os, const size_type start, const size_ty
}
-const stringProxy::size_type stringProxy::length() const
+stringProxy::size_type stringProxy::length() const
{
return (m_end - m_start);
}
-const stringProxy::size_type stringProxy::start() const
+stringProxy::size_type stringProxy::start() const
{
return (m_start);
}
-const stringProxy::size_type stringProxy::end() const
+stringProxy::size_type stringProxy::end() const
{
return (m_end);
}
diff --git a/src/utility/stringUtils.cpp b/src/utility/stringUtils.cpp
index 65c3d66d..9566599c 100644
--- a/src/utility/stringUtils.cpp
+++ b/src/utility/stringUtils.cpp
@@ -29,7 +29,7 @@ namespace vmime {
namespace utility {
-const bool stringUtils::isStringEqualNoCase
+bool stringUtils::isStringEqualNoCase
(const string& s1, const char* s2, const string::size_type n)
{
// 'n' is the number of characters to compare
@@ -49,7 +49,7 @@ const bool stringUtils::isStringEqualNoCase
}
-const bool stringUtils::isStringEqualNoCase(const string& s1, const string& s2)
+bool stringUtils::isStringEqualNoCase(const string& s1, const string& s2)
{
if (s1.length() != s2.length())
return (false);
@@ -67,7 +67,7 @@ const bool stringUtils::isStringEqualNoCase(const string& s1, const string& s2)
}
-const bool stringUtils::isStringEqualNoCase
+bool stringUtils::isStringEqualNoCase
(const string::const_iterator begin, const string::const_iterator end,
const char* s, const string::size_type n)
{
@@ -125,15 +125,15 @@ const string stringUtils::trim(const string& str)
if (b != e)
{
- for ( ; b != e && parserHelpers::isSpace(*b) ; ++b);
- for ( ; e != b && parserHelpers::isSpace(*(e - 1)) ; --e);
+ for ( ; b != e && parserHelpers::isSpace(*b) ; ++b) {}
+ for ( ; e != b && parserHelpers::isSpace(*(e - 1)) ; --e) {}
}
return (string(b, e));
}
-const string::size_type stringUtils::countASCIIchars
+string::size_type stringUtils::countASCIIchars
(const string::const_iterator begin, const string::const_iterator end)
{
string::size_type count = 0;
diff --git a/src/utility/url.cpp b/src/utility/url.cpp
index 8cf1f7d7..7f609c7f 100644
--- a/src/utility/url.cpp
+++ b/src/utility/url.cpp
@@ -369,7 +369,7 @@ void url::setHost(const string& host)
}
-const port_t url::getPort() const
+port_t url::getPort() const
{
return (m_port);
}
diff --git a/src/utility/urlUtils.cpp b/src/utility/urlUtils.cpp
index a4d31469..d4243dfd 100644
--- a/src/utility/urlUtils.cpp
+++ b/src/utility/urlUtils.cpp
@@ -40,7 +40,7 @@ const string urlUtils::encode(const string& s)
for (string::const_iterator it = s.begin() ; it != s.end() ; ++it)
{
- const char_t c = *it;
+ const string::value_type c = *it;
if (parserHelpers::isPrint(c) && !parserHelpers::isSpace(c) &&
static_cast <unsigned char>(c) <= 127 &&
@@ -73,7 +73,7 @@ const string urlUtils::decode(const string& s)
for (string::const_iterator it = s.begin() ; it != s.end() ; )
{
- const char_t c = *it;
+ const string::value_type c = *it;
switch (c)
{
@@ -84,7 +84,7 @@ const string urlUtils::decode(const string& s)
const char_t p = (it != s.end() ? *(it++) : 0);
const char_t q = (it != s.end() ? *(it++) : 0);
- unsigned char r = 0;
+ unsigned int r = 0;
switch (p)
{
diff --git a/src/word.cpp b/src/word.cpp
index 3a0605ff..b129965d 100644
--- a/src/word.cpp
+++ b/src/word.cpp
@@ -246,21 +246,21 @@ void word::parse(const string& buffer, const string::size_type position,
const string::const_iterator charsetPos = p;
- for ( ; p != pend && *p != '?' ; ++p);
+ for ( ; p != pend && *p != '?' ; ++p) {}
if (p != pend) // a charset is specified
{
const string::const_iterator charsetEnd = p;
const string::const_iterator encPos = ++p; // skip '?'
- for ( ; p != pend && *p != '?' ; ++p);
+ for ( ; p != pend && *p != '?' ; ++p) {}
if (p != pend) // an encoding is specified
{
//const string::const_iterator encEnd = p;
const string::const_iterator dataPos = ++p; // skip '?'
- for ( ; p != pend && !(*p == '?' && *(p + 1) == '=') ; ++p);
+ for ( ; p != pend && !(*p == '?' && *(p + 1) == '=') ; ++p) {}
if (p != pend) // some data is specified
{
@@ -647,13 +647,13 @@ void word::copyFrom(const component& other)
}
-const bool word::operator==(const word& w) const
+bool word::operator==(const word& w) const
{
return (m_charset == w.m_charset && m_buffer == w.m_buffer);
}
-const bool word::operator!=(const word& w) const
+bool word::operator!=(const word& w) const
{
return (m_charset != w.m_charset || m_buffer != w.m_buffer);
}
diff --git a/src/wordEncoder.cpp b/src/wordEncoder.cpp
index 1b7643c6..9888c169 100644
--- a/src/wordEncoder.cpp
+++ b/src/wordEncoder.cpp
@@ -72,7 +72,7 @@ wordEncoder::wordEncoder(const string& buffer, const charset& charset, const Enc
}
-static const string::size_type getUTF8CharLength
+static string::size_type getUTF8CharLength
(const string& buffer, const string::size_type pos, const string::size_type length)
{
// Gives the number of extra bytes in a UTF8 char, given the leading char
@@ -253,14 +253,14 @@ const string wordEncoder::getNextChunk(const string::size_type maxLength)
}
-const wordEncoder::Encoding wordEncoder::getEncoding() const
+wordEncoder::Encoding wordEncoder::getEncoding() const
{
return m_encoding;
}
// static
-const wordEncoder::Encoding wordEncoder::guessBestEncoding
+wordEncoder::Encoding wordEncoder::guessBestEncoding
(const string& buffer, const charset& charset)
{
// If the charset is ISO-8859-x, set to QP encoding