aboutsummaryrefslogtreecommitdiffstats
path: root/src/utility
diff options
context:
space:
mode:
Diffstat (limited to '')
-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
11 files changed, 66 insertions, 66 deletions
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)
{