Homogeneous use of vmime::string.

This commit is contained in:
Vincent Richard 2013-06-12 14:20:34 +02:00
parent 7ab35173bc
commit f2211877a9
16 changed files with 25 additions and 25 deletions

View File

@ -150,7 +150,7 @@ void component::parseImpl
{ {
// This is the default implementation for parsing from an input stream: // This is the default implementation for parsing from an input stream:
// actually, we extract the substring and use the "parse from string" implementation // actually, we extract the substring and use the "parse from string" implementation
const std::string buffer = parser->extract(position, end); const string buffer = parser->extract(position, end);
parseImpl(ctx, buffer, 0, buffer.length(), newPosition); parseImpl(ctx, buffer, 0, buffer.length(), newPosition);
// Recursivey offset parsed bounds on children // Recursivey offset parsed bounds on children

View File

@ -292,7 +292,7 @@ const char* no_object_found::name() const throw() { return "no_object_found"; }
no_such_property::~no_such_property() throw() {} no_such_property::~no_such_property() throw() {}
no_such_property::no_such_property(const string& name, const exception& other) no_such_property::no_such_property(const string& name, const exception& other)
: exception(std::string("No such property: '") + name + string("'."), other) { } : exception(string("No such property: '") + name + string("'."), other) { }
exception* no_such_property::clone() const { return new no_such_property(*this); } exception* no_such_property::clone() const { return new no_such_property(*this); }
const char* no_such_property::name() const throw() { return "no_such_property"; } const char* no_such_property::name() const throw() { return "no_such_property"; }

View File

@ -1323,7 +1323,7 @@ void IMAPFolder::addMessage(ref <vmime::message> msg, const int flags,
msg->generate(ossAdapter); msg->generate(ossAdapter);
const std::string& str = oss.str(); const string& str = oss.str();
utility::inputStreamStringAdapter strAdapter(str); utility::inputStreamStringAdapter strAdapter(str);
addMessage(strAdapter, str.length(), flags, date, progress); addMessage(strAdapter, str.length(), flags, date, progress);

View File

@ -634,7 +634,7 @@ const string IMAPUtils::dateTime(const vmime::datetime& date)
// static // static
const string IMAPUtils::buildFetchRequestImpl const string IMAPUtils::buildFetchRequestImpl
(const std::string& mode, const std::string& set, const int options) (const string& mode, const string& set, const int options)
{ {
// Example: // Example:
// C: A654 FETCH 2:4 (FLAGS BODY[HEADER.FIELDS (DATE FROM)]) // C: A654 FETCH 2:4 (FLAGS BODY[HEADER.FIELDS (DATE FROM)])

View File

@ -834,7 +834,7 @@ void maildirFolder::addMessage(ref <vmime::message> msg, const int flags,
msg->generate(ossAdapter); msg->generate(ossAdapter);
const std::string& str = oss.str(); const string& str = oss.str();
utility::inputStreamStringAdapter strAdapter(str); utility::inputStreamStringAdapter strAdapter(str);
addMessage(strAdapter, str.length(), flags, date, progress); addMessage(strAdapter, str.length(), flags, date, progress);

View File

@ -203,7 +203,7 @@ ref <POP3Command> POP3Command::QUIT()
// static // static
ref <POP3Command> POP3Command::createCommand(const std::string& text) ref <POP3Command> POP3Command::createCommand(const string& text)
{ {
return vmime::create <POP3Command>(text); return vmime::create <POP3Command>(text);
} }

View File

@ -40,14 +40,14 @@ namespace net {
namespace smtp { namespace smtp {
SMTPCommand::SMTPCommand(const std::string& text) SMTPCommand::SMTPCommand(const string& text)
: m_text(text) : m_text(text)
{ {
} }
// static // static
ref <SMTPCommand> SMTPCommand::EHLO(const std::string& hostname) ref <SMTPCommand> SMTPCommand::EHLO(const string& hostname)
{ {
std::ostringstream cmd; std::ostringstream cmd;
cmd.imbue(std::locale::classic()); cmd.imbue(std::locale::classic());
@ -58,7 +58,7 @@ ref <SMTPCommand> SMTPCommand::EHLO(const std::string& hostname)
// static // static
ref <SMTPCommand> SMTPCommand::HELO(const std::string& hostname) ref <SMTPCommand> SMTPCommand::HELO(const string& hostname)
{ {
std::ostringstream cmd; std::ostringstream cmd;
cmd.imbue(std::locale::classic()); cmd.imbue(std::locale::classic());
@ -69,7 +69,7 @@ ref <SMTPCommand> SMTPCommand::HELO(const std::string& hostname)
// static // static
ref <SMTPCommand> SMTPCommand::AUTH(const std::string& mechName) ref <SMTPCommand> SMTPCommand::AUTH(const string& mechName)
{ {
std::ostringstream cmd; std::ostringstream cmd;
cmd.imbue(std::locale::classic()); cmd.imbue(std::locale::classic());
@ -147,7 +147,7 @@ ref <SMTPCommand> SMTPCommand::QUIT()
// static // static
ref <SMTPCommand> SMTPCommand::createCommand(const std::string& text) ref <SMTPCommand> SMTPCommand::createCommand(const string& text)
{ {
return vmime::create <SMTPCommand>(text); return vmime::create <SMTPCommand>(text);
} }

View File

@ -290,7 +290,7 @@ void parameter::generateImpl
// value is to be generated. // value is to be generated.
// A stream for a temporary storage // A stream for a temporary storage
std::string sevenBitBuffer; string sevenBitBuffer;
utility::outputStreamStringAdapter sevenBitStream(sevenBitBuffer); utility::outputStreamStringAdapter sevenBitStream(sevenBitBuffer);
string::size_type pos = curLinePos; string::size_type pos = curLinePos;

View File

@ -131,7 +131,7 @@ void propertySet::parse(const string& props)
{ {
value.reserve(50); value.reserve(50);
const std::string::value_type quoteChar = *pos; const string::value_type quoteChar = *pos;
bool theEnd = false; bool theEnd = false;
bool escape = false; bool escape = false;

View File

@ -306,7 +306,7 @@ void LFToCRLFFilteredOutputStream::write
if (count == 0) if (count == 0)
return; return;
std::string buffer; string buffer;
buffer.reserve(count); buffer.reserve(count);
const value_type* pos = data; const value_type* pos = data;

View File

@ -88,7 +88,7 @@ const string parserInputStreamAdapter::extract(const size_type begin, const size
stream::size_type parserInputStreamAdapter::findNext stream::size_type parserInputStreamAdapter::findNext
(const std::string& token, const size_type startPosition) (const string& token, const size_type startPosition)
{ {
static const unsigned int BUFFER_SIZE = 4096; static const unsigned int BUFFER_SIZE = 4096;

View File

@ -143,7 +143,7 @@ public:
private: private:
static const string buildFetchRequestImpl static const string buildFetchRequestImpl
(const std::string& mode, const std::string& set, const int options); (const string& mode, const string& set, const int options);
}; };

View File

@ -59,9 +59,9 @@ class VMIME_EXPORT SMTPCommand : public object
public: public:
static ref <SMTPCommand> HELO(const std::string& hostname); static ref <SMTPCommand> HELO(const string& hostname);
static ref <SMTPCommand> EHLO(const std::string& hostname); static ref <SMTPCommand> EHLO(const string& hostname);
static ref <SMTPCommand> AUTH(const std::string& mechName); static ref <SMTPCommand> AUTH(const string& mechName);
static ref <SMTPCommand> STARTTLS(); static ref <SMTPCommand> STARTTLS();
static ref <SMTPCommand> MAIL(const mailbox& mbox); static ref <SMTPCommand> MAIL(const mailbox& mbox);
static ref <SMTPCommand> RCPT(const mailbox& mbox); static ref <SMTPCommand> RCPT(const mailbox& mbox);
@ -75,7 +75,7 @@ public:
* @param text command text * @param text command text
* @return a new SMTPCommand object * @return a new SMTPCommand object
*/ */
static ref <SMTPCommand> createCommand(const std::string& text); static ref <SMTPCommand> createCommand(const string& text);
/** Sends this command to the specified socket. /** Sends this command to the specified socket.
* *
@ -92,12 +92,12 @@ public:
protected: protected:
SMTPCommand(const std::string& text); SMTPCommand(const string& text);
SMTPCommand(const SMTPCommand&); SMTPCommand(const SMTPCommand&);
private: private:
std::string m_text; string m_text;
}; };

View File

@ -341,7 +341,7 @@ private:
private: private:
const std::string m_name; const string m_name;
}; };
ref <property> find(const string& name) const; ref <property> find(const string& name) const;

View File

@ -70,7 +70,7 @@ private:
}; };
typedef std::map <std::string, ref <digestAlgorithmFactory> > MapType; typedef std::map <string, ref <digestAlgorithmFactory> > MapType;
MapType m_algos; MapType m_algos;
public: public:

View File

@ -157,7 +157,7 @@ public:
return pos - initialPos; return pos - initialPos;
} }
size_type findNext(const std::string& token, const size_type startPosition = 0); size_type findNext(const string& token, const size_type startPosition = 0);
private: private: