Fixed compilation warnings.

This commit is contained in:
Vincent Richard 2008-10-12 10:05:28 +00:00
parent 3d5b699cd9
commit 3f4226eaac
207 changed files with 796 additions and 789 deletions

View File

@ -346,7 +346,7 @@ static void printFolders(vmime::ref <vmime::net::folder> folder, const int level
*
* @param choices menu choices
*/
static const unsigned int printMenu(const std::vector <std::string>& choices)
static unsigned int printMenu(const std::vector <std::string>& choices)
{
std::cout << std::endl;
@ -780,7 +780,7 @@ static void connectStore()
*
* @return true to quit the program, false to continue
*/
static const bool menu()
static bool menu()
{
std::vector <std::string> items;

View File

@ -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());
}

View File

@ -36,7 +36,7 @@ namespace vmime
// static
const bool attachmentHelper::isBodyPartAnAttachment(ref <const bodyPart> part)
bool attachmentHelper::isBodyPartAnAttachment(ref <const bodyPart> part)
{
try
{

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);

View File

@ -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);

View File

@ -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);
}

View File

@ -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...

View File

@ -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...

View File

@ -81,7 +81,7 @@ const ref <const encoderFactory::registeredEncoder> encoderFactory::getEncoderBy
}
const int encoderFactory::getEncoderCount() const
int encoderFactory::getEncoderCount() const
{
return (m_encoders.size());
}

View File

@ -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;
}

View File

@ -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...

View File

@ -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);
}

View File

@ -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); } }

View File

@ -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;
}

View File

@ -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] == '-');
}

View File

@ -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_);

View File

@ -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);
}

View File

@ -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());
}

View File

@ -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());
}

View File

@ -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();

View File

@ -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);
}

View File

@ -291,7 +291,7 @@ ref <attachment> messageBuilder::getAttachmentAt(const int pos)
}
const int messageBuilder::getAttachmentCount() const
int messageBuilder::getAttachmentCount() const
{
return (m_attach.size());
}

View File

@ -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);
}

View File

@ -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());
}

View File

@ -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());
}

View File

@ -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

View File

@ -40,7 +40,7 @@ const string defaultConnectionInfos::getHost() const
}
const port_t defaultConnectionInfos::getPort() const
port_t defaultConnectionInfos::getPort() const
{
return m_port;
}

View File

@ -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

View File

@ -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);
}

View File

@ -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 |

View File

@ -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();

View File

@ -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 |

View File

@ -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);
}

View File

@ -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;

View File

@ -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();

View File

@ -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;

View File

@ -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 |

View File

@ -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();

View File

@ -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 |

View File

@ -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));

View File

@ -40,7 +40,7 @@ ref <part> part::getPartAt(const int pos)
}
const int part::getPartCount() const
int part::getPartCount() const
{
return getStructure()->getPartCount();
}

View File

@ -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 |

View File

@ -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;

View File

@ -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);
}

View File

@ -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));
}

View File

@ -100,7 +100,7 @@ ref <const serviceFactory::registeredService> serviceFactory::getServiceByProtoc
}
const int serviceFactory::getServiceCount() const
int serviceFactory::getServiceCount() const
{
return (m_services.size());
}

View File

@ -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);
}

View File

@ -58,7 +58,7 @@ public:
return (m_name);
}
const int getType() const
int getType() const
{
return (m_type);
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -45,7 +45,7 @@ const string TLSSecuredConnectionInfos::getHost() const
}
const port_t TLSSecuredConnectionInfos::getPort() const
port_t TLSSecuredConnectionInfos::getPort() const
{
return m_port;
}

View File

@ -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,

View File

@ -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);
}

View File

@ -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
}

View File

@ -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());
}

View File

@ -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);

View File

@ -51,7 +51,7 @@ const mediaType plainTextPart::getType() const
}
const int plainTextPart::getPartCount() const
int plainTextPart::getPartCount() const
{
return (1);
}

View File

@ -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;

View File

@ -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)
{

View File

@ -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());
}

View File

@ -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);

View File

@ -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);

View File

@ -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()));
}

View File

@ -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);

View File

@ -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");
}

View File

@ -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)

View File

@ -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>();

View File

@ -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());
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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());

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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());
}

View File

@ -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

View File

@ -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())

View File

@ -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);

View File

@ -37,7 +37,7 @@ progressListenerSizeAdapter::progressListenerSizeAdapter
}
const bool progressListenerSizeAdapter::cancel() const
bool progressListenerSizeAdapter::cancel() const
{
return (m_wrapped ? m_wrapped->cancel() : false);
}

View File

@ -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());
}

View File

@ -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;
}

View File

@ -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
}

View File

@ -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);
}

View File

@ -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;

View File

@ -369,7 +369,7 @@ void url::setHost(const string& host)
}
const port_t url::getPort() const
port_t url::getPort() const
{
return (m_port);
}

View File

@ -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)
{

View File

@ -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);
}

View File

@ -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

View File

@ -56,7 +56,7 @@ public:
gettimeofday(&m_start, &tz);
}
const double getDuration() const
double getDuration() const
{
struct timeval tv;
struct timezone tz;

View File

@ -45,7 +45,7 @@ void testSocket::disconnect()
}
const bool testSocket::isConnected() const
bool testSocket::isConnected() const
{
return m_connected;
}
@ -66,7 +66,7 @@ void testSocket::send(const vmime::string& buffer)
}
const int testSocket::receiveRaw(char* buffer, const int count)
int testSocket::receiveRaw(char* buffer, const int count)
{
const int n = std::min(count, static_cast <int>(m_inBuffer.size()));
@ -142,7 +142,7 @@ const vmime::string lineBasedTestSocket::getNextLine()
return line;
}
const bool lineBasedTestSocket::haveMoreLines() const
bool lineBasedTestSocket::haveMoreLines() const
{
return !m_lines.empty();
}
@ -156,7 +156,7 @@ testTimeoutHandler::testTimeoutHandler(const unsigned int delay)
}
const bool testTimeoutHandler::isTimeOut()
bool testTimeoutHandler::isTimeOut()
{
return (vmime::platform::getHandler()->getUnixTime() - m_start) >= m_delay;
}
@ -168,7 +168,7 @@ void testTimeoutHandler::resetTimeOut()
}
const bool testTimeoutHandler::handleTimeOut()
bool testTimeoutHandler::handleTimeOut()
{
return false;
}

View File

@ -208,12 +208,12 @@ public:
void connect(const vmime::string& address, const vmime::port_t port);
void disconnect();
const bool isConnected() const;
bool isConnected() const;
void receive(vmime::string& buffer);
void send(const vmime::string& buffer);
const int receiveRaw(char* buffer, const int count);
int receiveRaw(char* buffer, const int count);
void sendRaw(const char* buffer, const int count);
/** Send data to client.
@ -268,7 +268,7 @@ public:
void onDataReceived();
const vmime::string getNextLine();
const bool haveMoreLines() const;
bool haveMoreLines() const;
virtual void processCommand() = 0;
@ -285,9 +285,9 @@ public:
testTimeoutHandler(const unsigned int delay = 3);
const bool isTimeOut();
bool isTimeOut();
void resetTimeOut();
const bool handleTimeOut();
bool handleTimeOut();
private:

View File

@ -55,10 +55,10 @@ VMIME_TEST_SUITE_BEGIN
void addChunk(const std::string& chunk) { m_chunks.push_back(chunk); }
const bool eof() const { return (m_index >= m_chunks.size()); }
bool eof() const { return (m_index >= m_chunks.size()); }
void reset() { m_index = 0; }
const size_type read(value_type* const data, const size_type /* count */)
size_type read(value_type* const data, const size_type /* count */)
{
if (eof())
return 0;
@ -74,7 +74,7 @@ VMIME_TEST_SUITE_BEGIN
return chunk.length();
}
const size_type skip(const size_type /* count */)
size_type skip(const size_type /* count */)
{
// Not supported
return 0;

View File

@ -44,8 +44,8 @@ VMIME_TEST_SUITE_BEGIN
struct A : public vmime::object
{
const int strongCount() const { return getRefManager()->getStrongRefCount(); }
const int weakCount() const { return getRefManager()->getWeakRefCount(); }
int strongCount() const { return getRefManager()->getStrongRefCount(); }
int weakCount() const { return getRefManager()->getWeakRefCount(); }
};
struct B : public virtual A { };

View File

@ -48,7 +48,7 @@ VMIME_TEST_SUITE_BEGIN
VMIME_TEST_LIST_END
static const bool parseHelper(vmime::utility::url& u, const vmime::string& str)
static bool parseHelper(vmime::utility::url& u, const vmime::string& str)
{
try
{

Some files were not shown because too many files have changed in this diff Show More