Avoid copy by passing shared_ptr<> with const reference.
This commit is contained in:
parent
997616c629
commit
f173b0a535
@ -360,7 +360,7 @@ class mySASLAuthenticator : public vmime::security::sasl::defaultSASLAuthenticat
|
||||
|
||||
const std::vector <vmime::shared_ptr <mechanism> > getAcceptableMechanisms
|
||||
(const std::vector <vmime::shared_ptr <mechanism> >& available,
|
||||
vmime::shared_ptr <mechanism> suggested) const
|
||||
const vmime::shared_ptr <mechanism>& suggested) const
|
||||
{
|
||||
// Here, you can sort the SASL mechanisms in the order they will be
|
||||
// tried. If no SASL mechanism is acceptable (ie. for example, not
|
||||
@ -372,7 +372,7 @@ class mySASLAuthenticator : public vmime::security::sasl::defaultSASLAuthenticat
|
||||
getAcceptableMechanisms(available, suggested);
|
||||
}
|
||||
|
||||
void setSASLMechanism(vmime::shared_ptr <mechanism> mech)
|
||||
void setSASLMechanism(const vmime::shared_ptr <mechanism>& mech)
|
||||
{
|
||||
// This is called when the authentication process is going to
|
||||
// try the specified mechanism.
|
||||
@ -982,7 +982,7 @@ class myCertVerifier : public vmime::security::cert::certificateVerifier
|
||||
{
|
||||
public:
|
||||
|
||||
void verify(vmime::shared_ptr <certificateChain> certs)
|
||||
void verify(const vmime::shared_ptr <certificateChain>& certs)
|
||||
{
|
||||
// Obtain the subject's certificate
|
||||
vmime::shared_ptr <vmime::security::cert::certificate> cert = chain->getAt(0);
|
||||
@ -1130,7 +1130,7 @@ class myTracerFactory : public vmime::net::tracerFactory
|
||||
public:
|
||||
|
||||
vmime::shared_ptr <vmime::net::tracer> create
|
||||
(vmime::shared_ptr <vmime::net::service> serv,
|
||||
(const vmime::shared_ptr <vmime::net::service>& serv,
|
||||
const int connectionId)
|
||||
{
|
||||
return vmime::make_shared <myTracer>
|
||||
|
@ -7,7 +7,7 @@ class interactiveAuthenticator : public vmime::security::sasl::defaultSASLAuthen
|
||||
{
|
||||
const std::vector <vmime::shared_ptr <vmime::security::sasl::SASLMechanism> > getAcceptableMechanisms
|
||||
(const std::vector <vmime::shared_ptr <vmime::security::sasl::SASLMechanism> >& available,
|
||||
vmime::shared_ptr <vmime::security::sasl::SASLMechanism> suggested) const
|
||||
const vmime::shared_ptr <vmime::security::sasl::SASLMechanism>& suggested) const
|
||||
{
|
||||
std::cout << std::endl << "Available SASL mechanisms:" << std::endl;
|
||||
|
||||
@ -24,7 +24,7 @@ class interactiveAuthenticator : public vmime::security::sasl::defaultSASLAuthen
|
||||
return defaultSASLAuthenticator::getAcceptableMechanisms(available, suggested);
|
||||
}
|
||||
|
||||
void setSASLMechanism(vmime::shared_ptr <vmime::security::sasl::SASLMechanism> mech)
|
||||
void setSASLMechanism(const vmime::shared_ptr <vmime::security::sasl::SASLMechanism>& mech)
|
||||
{
|
||||
std::cout << "Trying '" << mech->getName() << "' authentication mechanism" << std::endl;
|
||||
|
||||
|
@ -7,7 +7,7 @@ class interactiveCertificateVerifier : public vmime::security::cert::defaultCert
|
||||
{
|
||||
public:
|
||||
|
||||
void verify(vmime::shared_ptr <vmime::security::cert::certificateChain> chain, const vmime::string& hostname)
|
||||
void verify(const vmime::shared_ptr <vmime::security::cert::certificateChain>& chain, const vmime::string& hostname)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -6,8 +6,8 @@ class myTracer : public vmime::net::tracer
|
||||
{
|
||||
public:
|
||||
|
||||
myTracer(vmime::shared_ptr <std::ostringstream> stream,
|
||||
vmime::shared_ptr <vmime::net::service> serv, const int connectionId)
|
||||
myTracer(const vmime::shared_ptr <std::ostringstream>& stream,
|
||||
const vmime::shared_ptr <vmime::net::service>& serv, const int connectionId)
|
||||
: m_stream(stream), m_service(serv), m_connectionId(connectionId)
|
||||
{
|
||||
}
|
||||
@ -35,13 +35,13 @@ class myTracerFactory : public vmime::net::tracerFactory
|
||||
{
|
||||
public:
|
||||
|
||||
myTracerFactory(vmime::shared_ptr <std::ostringstream> stream)
|
||||
myTracerFactory(const vmime::shared_ptr <std::ostringstream>& stream)
|
||||
: m_stream(stream)
|
||||
{
|
||||
}
|
||||
|
||||
vmime::shared_ptr <vmime::net::tracer> create
|
||||
(vmime::shared_ptr <vmime::net::service> serv, const int connectionId)
|
||||
(const vmime::shared_ptr <vmime::net::service>& serv, const int connectionId)
|
||||
{
|
||||
return vmime::make_shared <myTracer>(m_stream, serv, connectionId);
|
||||
}
|
||||
|
@ -139,13 +139,13 @@ shared_ptr <component> addressList::clone() const
|
||||
}
|
||||
|
||||
|
||||
void addressList::appendAddress(shared_ptr <address> addr)
|
||||
void addressList::appendAddress(const shared_ptr <address> &addr)
|
||||
{
|
||||
m_list.push_back(addr);
|
||||
}
|
||||
|
||||
|
||||
void addressList::insertAddressBefore(shared_ptr <address> beforeAddress, shared_ptr <address> addr)
|
||||
void addressList::insertAddressBefore(const shared_ptr <address>& beforeAddress, const shared_ptr <address>& addr)
|
||||
{
|
||||
const std::vector <shared_ptr <address> >::iterator it = std::find
|
||||
(m_list.begin(), m_list.end(), beforeAddress);
|
||||
@ -157,7 +157,7 @@ void addressList::insertAddressBefore(shared_ptr <address> beforeAddress, shared
|
||||
}
|
||||
|
||||
|
||||
void addressList::insertAddressBefore(const size_t pos, shared_ptr <address> addr)
|
||||
void addressList::insertAddressBefore(const size_t pos, const shared_ptr <address>& addr)
|
||||
{
|
||||
if (pos >= m_list.size())
|
||||
throw std::out_of_range("Invalid position");
|
||||
@ -166,7 +166,7 @@ void addressList::insertAddressBefore(const size_t pos, shared_ptr <address> add
|
||||
}
|
||||
|
||||
|
||||
void addressList::insertAddressAfter(shared_ptr <address> afterAddress, shared_ptr <address> addr)
|
||||
void addressList::insertAddressAfter(const shared_ptr <address>& afterAddress, const shared_ptr <address>& addr)
|
||||
{
|
||||
const std::vector <shared_ptr <address> >::iterator it = std::find
|
||||
(m_list.begin(), m_list.end(), afterAddress);
|
||||
@ -178,7 +178,7 @@ void addressList::insertAddressAfter(shared_ptr <address> afterAddress, shared_p
|
||||
}
|
||||
|
||||
|
||||
void addressList::insertAddressAfter(const size_t pos, shared_ptr <address> addr)
|
||||
void addressList::insertAddressAfter(const size_t pos, const shared_ptr <address>& addr)
|
||||
{
|
||||
if (pos >= m_list.size())
|
||||
throw std::out_of_range("Invalid position");
|
||||
@ -187,7 +187,7 @@ void addressList::insertAddressAfter(const size_t pos, shared_ptr <address> addr
|
||||
}
|
||||
|
||||
|
||||
void addressList::removeAddress(shared_ptr <address> addr)
|
||||
void addressList::removeAddress(const shared_ptr <address>& addr)
|
||||
{
|
||||
const std::vector <shared_ptr <address> >::iterator it = std::find
|
||||
(m_list.begin(), m_list.end(), addr);
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
*
|
||||
* @param addr address to append
|
||||
*/
|
||||
void appendAddress(shared_ptr <address> addr);
|
||||
void appendAddress(const shared_ptr <address>& addr);
|
||||
|
||||
/** Insert a new address before the specified address.
|
||||
*
|
||||
@ -71,7 +71,7 @@ public:
|
||||
* @param addr address to insert
|
||||
* @throw std::out_of_range if the address is not in the list
|
||||
*/
|
||||
void insertAddressBefore(shared_ptr <address> beforeAddress, shared_ptr <address> addr);
|
||||
void insertAddressBefore(const shared_ptr <address>& beforeAddress, const shared_ptr <address>& addr);
|
||||
|
||||
/** Insert a new address before the specified position.
|
||||
*
|
||||
@ -80,7 +80,7 @@ public:
|
||||
* @param addr address to insert
|
||||
* @throw std::out_of_range if the position is out of range
|
||||
*/
|
||||
void insertAddressBefore(const size_t pos, shared_ptr <address> addr);
|
||||
void insertAddressBefore(const size_t pos, const shared_ptr <address>& addr);
|
||||
|
||||
/** Insert a new address after the specified address.
|
||||
*
|
||||
@ -88,7 +88,7 @@ public:
|
||||
* @param addr address to insert
|
||||
* @throw std::out_of_range if the address is not in the list
|
||||
*/
|
||||
void insertAddressAfter(shared_ptr <address> afterAddress, shared_ptr <address> addr);
|
||||
void insertAddressAfter(const shared_ptr <address>& afterAddress, const shared_ptr <address>& addr);
|
||||
|
||||
/** Insert a new address after the specified position.
|
||||
*
|
||||
@ -96,14 +96,14 @@ public:
|
||||
* @param addr address to insert
|
||||
* @throw std::out_of_range if the position is out of range
|
||||
*/
|
||||
void insertAddressAfter(const size_t pos, shared_ptr <address> addr);
|
||||
void insertAddressAfter(const size_t pos, const shared_ptr <address>& addr);
|
||||
|
||||
/** Remove the specified address from the list.
|
||||
*
|
||||
* @param addr address to remove
|
||||
* @throw std::out_of_range if the address is not in the list
|
||||
*/
|
||||
void removeAddress(shared_ptr <address> addr);
|
||||
void removeAddress(const shared_ptr <address>& addr);
|
||||
|
||||
/** Remove the address at the specified position.
|
||||
*
|
||||
|
@ -108,7 +108,7 @@ protected:
|
||||
*
|
||||
* @param parent body part in which to generate the attachment
|
||||
*/
|
||||
virtual void generateIn(shared_ptr <bodyPart> parent) const = 0;
|
||||
virtual void generateIn(const shared_ptr <bodyPart>& parent) const = 0;
|
||||
};
|
||||
|
||||
|
||||
|
@ -39,7 +39,7 @@ namespace vmime
|
||||
|
||||
// static
|
||||
bool attachmentHelper::isBodyPartAnAttachment
|
||||
(shared_ptr <const bodyPart> part, const unsigned int options)
|
||||
(const shared_ptr <const bodyPart>& part, const unsigned int options)
|
||||
{
|
||||
// First, try with "Content-Disposition" field.
|
||||
// If not present, we will try with "Content-Type" field.
|
||||
@ -123,7 +123,7 @@ bool attachmentHelper::isBodyPartAnAttachment
|
||||
|
||||
// static
|
||||
shared_ptr <const attachment> attachmentHelper::getBodyPartAttachment
|
||||
(shared_ptr <const bodyPart> part, const unsigned int options)
|
||||
(const shared_ptr <const bodyPart>& part, const unsigned int options)
|
||||
{
|
||||
if (!isBodyPartAnAttachment(part, options))
|
||||
return null;
|
||||
@ -159,7 +159,7 @@ shared_ptr <const attachment> attachmentHelper::getBodyPartAttachment
|
||||
// static
|
||||
const std::vector <shared_ptr <const attachment> >
|
||||
attachmentHelper::findAttachmentsInMessage
|
||||
(shared_ptr <const message> msg, const unsigned int options)
|
||||
(const shared_ptr <const message>& msg, const unsigned int options)
|
||||
{
|
||||
return findAttachmentsInBodyPart(msg, options);
|
||||
}
|
||||
@ -168,7 +168,7 @@ const std::vector <shared_ptr <const attachment> >
|
||||
// static
|
||||
const std::vector <shared_ptr <const attachment> >
|
||||
attachmentHelper::findAttachmentsInBodyPart
|
||||
(shared_ptr <const bodyPart> part, const unsigned int options)
|
||||
(const shared_ptr <const bodyPart>& part, const unsigned int options)
|
||||
{
|
||||
std::vector <shared_ptr <const attachment> > atts;
|
||||
|
||||
@ -196,7 +196,7 @@ const std::vector <shared_ptr <const attachment> >
|
||||
|
||||
|
||||
// static
|
||||
void attachmentHelper::addAttachment(shared_ptr <message> msg, shared_ptr <attachment> att)
|
||||
void attachmentHelper::addAttachment(const shared_ptr <message>& msg, const shared_ptr <attachment>& att)
|
||||
{
|
||||
// We simply search for a "multipart/mixed" part. If no one exists,
|
||||
// create it in the root part. This (very simple) algorithm should
|
||||
@ -279,7 +279,7 @@ void attachmentHelper::addAttachment(shared_ptr <message> msg, shared_ptr <attac
|
||||
|
||||
// static
|
||||
shared_ptr <bodyPart> attachmentHelper::findBodyPart
|
||||
(shared_ptr <bodyPart> part, const mediaType& type)
|
||||
(const shared_ptr <bodyPart>& part, const mediaType& type)
|
||||
{
|
||||
if (part->getBody()->getContentType() == type)
|
||||
return part;
|
||||
@ -301,7 +301,7 @@ shared_ptr <bodyPart> attachmentHelper::findBodyPart
|
||||
|
||||
|
||||
// static
|
||||
void attachmentHelper::addAttachment(shared_ptr <message> msg, shared_ptr <message> amsg)
|
||||
void attachmentHelper::addAttachment(const shared_ptr <message>& msg, const shared_ptr <message>& amsg)
|
||||
{
|
||||
shared_ptr <attachment> att = make_shared <parsedMessageAttachment>(amsg);
|
||||
addAttachment(msg, att);
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
* @param options search options (see FindOptions)
|
||||
* @return true if the part is an attachment, false otherwise
|
||||
*/
|
||||
static bool isBodyPartAnAttachment(shared_ptr <const bodyPart> part, const unsigned int options = 0);
|
||||
static bool isBodyPartAnAttachment(const shared_ptr <const bodyPart>& part, const unsigned int options = 0);
|
||||
|
||||
/** Return attachment information in the specified body part.
|
||||
* If the specified body part does not contain attachment
|
||||
@ -70,7 +70,7 @@ public:
|
||||
* @return attachment found in the part, or NULL
|
||||
*/
|
||||
static shared_ptr <const attachment>
|
||||
getBodyPartAttachment(shared_ptr <const bodyPart> part, const unsigned int options = 0);
|
||||
getBodyPartAttachment(const shared_ptr <const bodyPart>& part, const unsigned int options = 0);
|
||||
|
||||
/** Find all attachments contained in the specified part
|
||||
* and all its children parts.
|
||||
@ -81,7 +81,7 @@ public:
|
||||
* @return a list of attachments found
|
||||
*/
|
||||
static const std::vector <shared_ptr <const attachment> >
|
||||
findAttachmentsInBodyPart(shared_ptr <const bodyPart> part, const unsigned int options = 0);
|
||||
findAttachmentsInBodyPart(const shared_ptr <const bodyPart>& part, const unsigned int options = 0);
|
||||
|
||||
/** Find all attachments contained in the specified message.
|
||||
* This is simply a recursive call to getBodyPartAttachment().
|
||||
@ -91,26 +91,26 @@ public:
|
||||
* @return a list of attachments found
|
||||
*/
|
||||
static const std::vector <shared_ptr <const attachment> >
|
||||
findAttachmentsInMessage(shared_ptr <const message> msg, const unsigned int options = 0);
|
||||
findAttachmentsInMessage(const shared_ptr <const message>& msg, const unsigned int options = 0);
|
||||
|
||||
/** Add an attachment to the specified message.
|
||||
*
|
||||
* @param msg message into which to add the attachment
|
||||
* @param att attachment to add
|
||||
*/
|
||||
static void addAttachment(shared_ptr <message> msg, shared_ptr <attachment> att);
|
||||
static void addAttachment(const shared_ptr <message>& msg, const shared_ptr <attachment>& att);
|
||||
|
||||
/** Add a message attachment to the specified message.
|
||||
*
|
||||
* @param msg message into which to add the attachment
|
||||
* @param amsg message to attach
|
||||
*/
|
||||
static void addAttachment(shared_ptr <message> msg, shared_ptr <message> amsg);
|
||||
static void addAttachment(const shared_ptr <message>& msg, const shared_ptr <message>& amsg);
|
||||
|
||||
protected:
|
||||
|
||||
static shared_ptr <bodyPart> findBodyPart
|
||||
(shared_ptr <bodyPart> part, const mediaType& type);
|
||||
(const shared_ptr <bodyPart>& part, const mediaType& type);
|
||||
};
|
||||
|
||||
|
||||
|
@ -192,7 +192,7 @@ namespace vmime
|
||||
* This is an alias for dynamic_pointer_cast <T>(obj->clone()).
|
||||
*/
|
||||
template <class T>
|
||||
shared_ptr <T> clone(shared_ptr <T> obj)
|
||||
shared_ptr <T> clone(const shared_ptr <T>& obj)
|
||||
{
|
||||
return dynamic_pointer_cast <T>(obj->clone());
|
||||
}
|
||||
@ -201,7 +201,7 @@ namespace vmime
|
||||
* This is an alias for dynamic_pointer_cast <T>(obj->clone()).
|
||||
*/
|
||||
template <class T>
|
||||
shared_ptr <T> clone(shared_ptr <const T> obj)
|
||||
shared_ptr <T> clone(const shared_ptr <const T>& obj)
|
||||
{
|
||||
return dynamic_pointer_cast <T>(obj->clone());
|
||||
}
|
||||
@ -220,7 +220,7 @@ namespace vmime
|
||||
* type Type, and DerivedType is derived from Type.
|
||||
*/
|
||||
template <class X, class Y>
|
||||
shared_ptr <X> dynamicCast(shared_ptr <Y> obj)
|
||||
shared_ptr <X> dynamicCast(const shared_ptr <Y>& obj)
|
||||
{
|
||||
return dynamic_pointer_cast <X, Y>(obj);
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ body::~body()
|
||||
|
||||
// static
|
||||
size_t body::findNextBoundaryPosition
|
||||
(shared_ptr <utility::parserInputStreamAdapter> parser, const string& boundary,
|
||||
(const shared_ptr <utility::parserInputStreamAdapter>& parser, const string& boundary,
|
||||
const size_t position, const size_t end,
|
||||
size_t* boundaryStart, size_t* boundaryEnd)
|
||||
{
|
||||
@ -129,7 +129,7 @@ size_t body::findNextBoundaryPosition
|
||||
|
||||
void body::parseImpl
|
||||
(const parsingContext& ctx,
|
||||
shared_ptr <utility::parserInputStreamAdapter> parser,
|
||||
const shared_ptr <utility::parserInputStreamAdapter>& parser,
|
||||
const size_t position, const size_t end, size_t* newPosition)
|
||||
{
|
||||
removeAllParts();
|
||||
@ -839,13 +839,13 @@ const shared_ptr <const contentHandler> body::getContents() const
|
||||
}
|
||||
|
||||
|
||||
void body::setContents(shared_ptr <const contentHandler> contents)
|
||||
void body::setContents(const shared_ptr <const contentHandler>& contents)
|
||||
{
|
||||
m_contents = contents;
|
||||
}
|
||||
|
||||
|
||||
void body::setContents(shared_ptr <const contentHandler> contents, const mediaType& type)
|
||||
void body::setContents(const shared_ptr <const contentHandler>& contents, const mediaType& type)
|
||||
{
|
||||
m_contents = contents;
|
||||
|
||||
@ -853,7 +853,7 @@ void body::setContents(shared_ptr <const contentHandler> contents, const mediaTy
|
||||
}
|
||||
|
||||
|
||||
void body::setContents(shared_ptr <const contentHandler> contents, const mediaType& type, const charset& chset)
|
||||
void body::setContents(const shared_ptr <const contentHandler>& contents, const mediaType& type, const charset& chset)
|
||||
{
|
||||
m_contents = contents;
|
||||
|
||||
@ -861,7 +861,7 @@ void body::setContents(shared_ptr <const contentHandler> contents, const mediaTy
|
||||
}
|
||||
|
||||
|
||||
void body::setContents(shared_ptr <const contentHandler> contents, const mediaType& type,
|
||||
void body::setContents(const shared_ptr <const contentHandler>& contents, const mediaType& type,
|
||||
const charset& chset, const encoding& enc)
|
||||
{
|
||||
m_contents = contents;
|
||||
@ -871,7 +871,7 @@ void body::setContents(shared_ptr <const contentHandler> contents, const mediaTy
|
||||
}
|
||||
|
||||
|
||||
void body::initNewPart(shared_ptr <bodyPart> part)
|
||||
void body::initNewPart(const shared_ptr <bodyPart>& part)
|
||||
{
|
||||
// A part can be in only one body at the same time: if part is
|
||||
// already attached to a parent part, remove it from the current
|
||||
@ -923,7 +923,7 @@ void body::initNewPart(shared_ptr <bodyPart> part)
|
||||
}
|
||||
|
||||
|
||||
void body::appendPart(shared_ptr <bodyPart> part)
|
||||
void body::appendPart(const shared_ptr <bodyPart>& part)
|
||||
{
|
||||
initNewPart(part);
|
||||
|
||||
@ -931,7 +931,7 @@ void body::appendPart(shared_ptr <bodyPart> part)
|
||||
}
|
||||
|
||||
|
||||
void body::insertPartBefore(shared_ptr <bodyPart> beforePart, shared_ptr <bodyPart> part)
|
||||
void body::insertPartBefore(const shared_ptr <bodyPart>& beforePart, const shared_ptr <bodyPart>& part)
|
||||
{
|
||||
initNewPart(part);
|
||||
|
||||
@ -945,7 +945,7 @@ void body::insertPartBefore(shared_ptr <bodyPart> beforePart, shared_ptr <bodyPa
|
||||
}
|
||||
|
||||
|
||||
void body::insertPartBefore(const size_t pos, shared_ptr <bodyPart> part)
|
||||
void body::insertPartBefore(const size_t pos, const shared_ptr <bodyPart>& part)
|
||||
{
|
||||
initNewPart(part);
|
||||
|
||||
@ -953,7 +953,7 @@ void body::insertPartBefore(const size_t pos, shared_ptr <bodyPart> part)
|
||||
}
|
||||
|
||||
|
||||
void body::insertPartAfter(shared_ptr <bodyPart> afterPart, shared_ptr <bodyPart> part)
|
||||
void body::insertPartAfter(const shared_ptr <bodyPart>& afterPart, const shared_ptr <bodyPart>& part)
|
||||
{
|
||||
initNewPart(part);
|
||||
|
||||
@ -967,7 +967,7 @@ void body::insertPartAfter(shared_ptr <bodyPart> afterPart, shared_ptr <bodyPart
|
||||
}
|
||||
|
||||
|
||||
void body::insertPartAfter(const size_t pos, shared_ptr <bodyPart> part)
|
||||
void body::insertPartAfter(const size_t pos, const shared_ptr <bodyPart>& part)
|
||||
{
|
||||
initNewPart(part);
|
||||
|
||||
@ -975,7 +975,7 @@ void body::insertPartAfter(const size_t pos, shared_ptr <bodyPart> part)
|
||||
}
|
||||
|
||||
|
||||
void body::removePart(shared_ptr <bodyPart> part)
|
||||
void body::removePart(const shared_ptr <bodyPart>& part)
|
||||
{
|
||||
const std::vector <shared_ptr <bodyPart> >::iterator it = std::find
|
||||
(m_parts.begin(), m_parts.end(), part);
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
*
|
||||
* @param part part to append
|
||||
*/
|
||||
void appendPart(shared_ptr <bodyPart> part);
|
||||
void appendPart(const shared_ptr <bodyPart>& part);
|
||||
|
||||
/** Insert a new part before the specified part.
|
||||
*
|
||||
@ -68,7 +68,7 @@ public:
|
||||
* @param part part to insert
|
||||
* @throw exceptions::no_such_part if the part is not in the list
|
||||
*/
|
||||
void insertPartBefore(shared_ptr <bodyPart> beforePart, shared_ptr <bodyPart> part);
|
||||
void insertPartBefore(const shared_ptr <bodyPart>& beforePart, const shared_ptr <bodyPart>& part);
|
||||
|
||||
/** Insert a new part before the specified position.
|
||||
*
|
||||
@ -76,7 +76,7 @@ public:
|
||||
* the beginning of the list)
|
||||
* @param part part to insert
|
||||
*/
|
||||
void insertPartBefore(const size_t pos, shared_ptr <bodyPart> part);
|
||||
void insertPartBefore(const size_t pos, const shared_ptr <bodyPart>& part);
|
||||
|
||||
/** Insert a new part after the specified part.
|
||||
*
|
||||
@ -84,21 +84,21 @@ public:
|
||||
* @param part part to insert
|
||||
* @throw exceptions::no_such_part if the part is not in the list
|
||||
*/
|
||||
void insertPartAfter(shared_ptr <bodyPart> afterPart, shared_ptr <bodyPart> part);
|
||||
void insertPartAfter(const shared_ptr <bodyPart>& afterPart, const shared_ptr <bodyPart>& part);
|
||||
|
||||
/** Insert a new part after the specified position.
|
||||
*
|
||||
* @param pos position of the part before the new part
|
||||
* @param part part to insert
|
||||
*/
|
||||
void insertPartAfter(const size_t pos, shared_ptr <bodyPart> part);
|
||||
void insertPartAfter(const size_t pos, const shared_ptr <bodyPart>& part);
|
||||
|
||||
/** Remove the specified part from the list.
|
||||
*
|
||||
* @param part part to remove
|
||||
* @throw exceptions::no_such_part if the part is not in the list
|
||||
*/
|
||||
void removePart(shared_ptr <bodyPart> part);
|
||||
void removePart(const shared_ptr <bodyPart>& part);
|
||||
|
||||
/** Remove the part at the specified position.
|
||||
*
|
||||
@ -182,14 +182,14 @@ public:
|
||||
*
|
||||
* @param contents new body contents
|
||||
*/
|
||||
void setContents(shared_ptr <const contentHandler> contents);
|
||||
void setContents(const shared_ptr <const contentHandler>& contents);
|
||||
|
||||
/** Set the body contents and type.
|
||||
*
|
||||
* @param contents new body contents
|
||||
* @param type type of contents
|
||||
*/
|
||||
void setContents(shared_ptr <const contentHandler> contents, const mediaType& type);
|
||||
void setContents(const shared_ptr <const contentHandler>& contents, const mediaType& type);
|
||||
|
||||
/** Set the body contents, type and charset.
|
||||
*
|
||||
@ -197,7 +197,7 @@ public:
|
||||
* @param type type of contents
|
||||
* @param chset charset of contents
|
||||
*/
|
||||
void setContents(shared_ptr <const contentHandler> contents, const mediaType& type, const charset& chset);
|
||||
void setContents(const shared_ptr <const contentHandler>& contents, const mediaType& type, const charset& chset);
|
||||
|
||||
/** Set the body contents, type, charset and encoding.
|
||||
*
|
||||
@ -206,7 +206,7 @@ public:
|
||||
* @param chset charset of contents
|
||||
* @param enc contents encoding
|
||||
*/
|
||||
void setContents(shared_ptr <const contentHandler> contents, const mediaType& type,
|
||||
void setContents(const shared_ptr <const contentHandler>& contents, const mediaType& type,
|
||||
const charset& chset, const encoding& enc);
|
||||
|
||||
/** Set the MIME type and charset of contents.
|
||||
@ -301,7 +301,7 @@ private:
|
||||
|
||||
bool isRootPart() const;
|
||||
|
||||
void initNewPart(shared_ptr <bodyPart> part);
|
||||
void initNewPart(const shared_ptr <bodyPart>& part);
|
||||
|
||||
protected:
|
||||
|
||||
@ -318,14 +318,14 @@ protected:
|
||||
* @return the position of the boundary string, or npos if not found
|
||||
*/
|
||||
size_t findNextBoundaryPosition
|
||||
(shared_ptr <utility::parserInputStreamAdapter> parser, const string& boundary,
|
||||
(const shared_ptr <utility::parserInputStreamAdapter>& parser, const string& boundary,
|
||||
const size_t position, const size_t end,
|
||||
size_t* boundaryStart, size_t* boundaryEnd);
|
||||
|
||||
// Component parsing & assembling
|
||||
void parseImpl
|
||||
(const parsingContext& ctx,
|
||||
shared_ptr <utility::parserInputStreamAdapter> parser,
|
||||
const shared_ptr <utility::parserInputStreamAdapter>& parser,
|
||||
const size_t position,
|
||||
const size_t end,
|
||||
size_t* newPosition = NULL);
|
||||
|
@ -38,7 +38,7 @@ bodyPart::bodyPart()
|
||||
|
||||
|
||||
void bodyPart::parseImpl
|
||||
(const parsingContext& ctx, shared_ptr <utility::parserInputStreamAdapter> parser,
|
||||
(const parsingContext& ctx, const shared_ptr <utility::parserInputStreamAdapter>& parser,
|
||||
const size_t position, const size_t end, size_t* newPosition)
|
||||
{
|
||||
// Parse the headers
|
||||
@ -117,7 +117,7 @@ shared_ptr <header> bodyPart::getHeader()
|
||||
}
|
||||
|
||||
|
||||
void bodyPart::setHeader(shared_ptr <header> h)
|
||||
void bodyPart::setHeader(const shared_ptr <header>& h)
|
||||
{
|
||||
m_header = h;
|
||||
}
|
||||
@ -135,7 +135,7 @@ shared_ptr <body> bodyPart::getBody()
|
||||
}
|
||||
|
||||
|
||||
void bodyPart::setBody(shared_ptr <body> b)
|
||||
void bodyPart::setBody(const shared_ptr <body>& b)
|
||||
{
|
||||
bodyPart* oldPart = b->m_part;
|
||||
|
||||
@ -169,7 +169,7 @@ shared_ptr <bodyPart> bodyPart::createChildPart()
|
||||
}
|
||||
|
||||
|
||||
void bodyPart::importChildPart(shared_ptr <bodyPart> part)
|
||||
void bodyPart::importChildPart(const shared_ptr <bodyPart>& part)
|
||||
{
|
||||
part->m_parent = this;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
*
|
||||
* @param header the new header of this part
|
||||
*/
|
||||
void setHeader(shared_ptr <header> header);
|
||||
void setHeader(const shared_ptr <header>& header);
|
||||
|
||||
/** Return the body section of this part.
|
||||
*
|
||||
@ -81,7 +81,7 @@ public:
|
||||
*
|
||||
* @param body new body section
|
||||
*/
|
||||
void setBody(shared_ptr <body> body);
|
||||
void setBody(const shared_ptr <body>& body);
|
||||
|
||||
/** Return the parent part of this part.
|
||||
*
|
||||
@ -131,12 +131,12 @@ protected:
|
||||
*
|
||||
* @param part child part to attach
|
||||
*/
|
||||
void importChildPart(shared_ptr <bodyPart> part);
|
||||
void importChildPart(const shared_ptr <bodyPart>& part);
|
||||
|
||||
// Component parsing & assembling
|
||||
void parseImpl
|
||||
(const parsingContext& ctx,
|
||||
shared_ptr <utility::parserInputStreamAdapter> parser,
|
||||
const shared_ptr <utility::parserInputStreamAdapter>& parser,
|
||||
const size_t position,
|
||||
const size_t end,
|
||||
size_t* newPosition = NULL);
|
||||
|
@ -28,7 +28,7 @@ namespace vmime
|
||||
{
|
||||
|
||||
|
||||
bodyPartAttachment::bodyPartAttachment(shared_ptr <const bodyPart> part)
|
||||
bodyPartAttachment::bodyPartAttachment(const shared_ptr <const bodyPart>& part)
|
||||
: m_part(part)
|
||||
{
|
||||
}
|
||||
@ -136,7 +136,7 @@ shared_ptr <const contentTypeField> bodyPartAttachment::getContentType() const
|
||||
}
|
||||
|
||||
|
||||
void bodyPartAttachment::generateIn(shared_ptr <bodyPart> /* parent */) const
|
||||
void bodyPartAttachment::generateIn(const shared_ptr <bodyPart>& /* parent */) const
|
||||
{
|
||||
// Not used
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ class VMIME_EXPORT bodyPartAttachment : public attachment
|
||||
{
|
||||
public:
|
||||
|
||||
bodyPartAttachment(shared_ptr <const bodyPart> part);
|
||||
bodyPartAttachment(const shared_ptr <const bodyPart>& part);
|
||||
|
||||
const mediaType getType() const;
|
||||
const word getName() const;
|
||||
@ -58,7 +58,7 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
void generateIn(shared_ptr <bodyPart> parent) const;
|
||||
void generateIn(const shared_ptr <bodyPart>& parent) const;
|
||||
|
||||
shared_ptr <const contentDispositionField> getContentDisposition() const;
|
||||
shared_ptr <const contentTypeField> getContentType() const;
|
||||
|
@ -47,14 +47,14 @@ component::~component()
|
||||
|
||||
|
||||
void component::parse
|
||||
(shared_ptr <utility::inputStream> inputStream, const size_t length)
|
||||
(const shared_ptr <utility::inputStream>& inputStream, const size_t length)
|
||||
{
|
||||
parse(inputStream, 0, length, NULL);
|
||||
}
|
||||
|
||||
|
||||
void component::parse
|
||||
(shared_ptr <utility::inputStream> inputStream, const size_t position,
|
||||
(const shared_ptr <utility::inputStream>& inputStream, const size_t position,
|
||||
const size_t end, size_t* newPosition)
|
||||
{
|
||||
parse(parsingContext::getDefaultContext(), inputStream, position, end, newPosition);
|
||||
@ -63,7 +63,7 @@ void component::parse
|
||||
|
||||
void component::parse
|
||||
(const parsingContext& ctx,
|
||||
shared_ptr <utility::inputStream> inputStream, const size_t position,
|
||||
const shared_ptr <utility::inputStream>& inputStream, const size_t position,
|
||||
const size_t end, size_t* newPosition)
|
||||
{
|
||||
m_parsedOffset = m_parsedLength = 0;
|
||||
@ -144,7 +144,7 @@ void component::offsetParsedBounds(const size_t offset)
|
||||
|
||||
|
||||
void component::parseImpl
|
||||
(const parsingContext& ctx, shared_ptr <utility::parserInputStreamAdapter> parser,
|
||||
(const parsingContext& ctx, const shared_ptr <utility::parserInputStreamAdapter>& parser,
|
||||
const size_t position, const size_t end, size_t* newPosition)
|
||||
{
|
||||
// This is the default implementation for parsing from an input stream:
|
||||
|
@ -70,7 +70,7 @@ public:
|
||||
* @param inputStream stream from which to read data
|
||||
* @param length data length, in bytes (0 = unknown/not specified)
|
||||
*/
|
||||
void parse(shared_ptr <utility::inputStream> inputStream, const size_t length);
|
||||
void parse(const shared_ptr <utility::inputStream>& inputStream, const size_t length);
|
||||
|
||||
/** Parse RFC-822/MIME data for this component, using the default
|
||||
* parsing context.
|
||||
@ -112,7 +112,7 @@ public:
|
||||
* @param newPosition will receive the new position in the input stream
|
||||
*/
|
||||
void parse
|
||||
(shared_ptr <utility::inputStream> inputStream,
|
||||
(const shared_ptr <utility::inputStream>& inputStream,
|
||||
const size_t position,
|
||||
const size_t end,
|
||||
size_t* newPosition = NULL);
|
||||
@ -129,7 +129,7 @@ public:
|
||||
*/
|
||||
void parse
|
||||
(const parsingContext& ctx,
|
||||
shared_ptr <utility::inputStream> inputStream,
|
||||
const shared_ptr <utility::inputStream>& inputStream,
|
||||
const size_t position,
|
||||
const size_t end,
|
||||
size_t* newPosition = NULL);
|
||||
@ -224,7 +224,7 @@ protected:
|
||||
// AT LEAST ONE of these parseImpl() functions MUST be implemented in derived class
|
||||
virtual void parseImpl
|
||||
(const parsingContext& ctx,
|
||||
shared_ptr <utility::parserInputStreamAdapter> parser,
|
||||
const shared_ptr <utility::parserInputStreamAdapter>& parser,
|
||||
const size_t position,
|
||||
const size_t end,
|
||||
size_t* newPosition = NULL);
|
||||
|
@ -37,14 +37,14 @@ defaultAttachment::defaultAttachment()
|
||||
}
|
||||
|
||||
|
||||
defaultAttachment::defaultAttachment(shared_ptr <const contentHandler> data,
|
||||
defaultAttachment::defaultAttachment(const shared_ptr <const contentHandler>& data,
|
||||
const encoding& enc, const mediaType& type, const text& desc, const word& name)
|
||||
: m_type(type), m_desc(desc), m_data(data), m_encoding(enc), m_name(name)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
defaultAttachment::defaultAttachment(shared_ptr <const contentHandler> data,
|
||||
defaultAttachment::defaultAttachment(const shared_ptr <const contentHandler>& data,
|
||||
const mediaType& type, const text& desc, const word& name)
|
||||
: m_type(type), m_desc(desc), m_data(data),
|
||||
m_encoding(encoding::decide(data)), m_name(name)
|
||||
@ -77,7 +77,7 @@ defaultAttachment& defaultAttachment::operator=(const defaultAttachment& attach)
|
||||
}
|
||||
|
||||
|
||||
void defaultAttachment::generateIn(shared_ptr <bodyPart> parent) const
|
||||
void defaultAttachment::generateIn(const shared_ptr <bodyPart>& parent) const
|
||||
{
|
||||
// Create and append a new part for this attachment
|
||||
shared_ptr <bodyPart> part = make_shared <bodyPart>();
|
||||
@ -87,7 +87,7 @@ void defaultAttachment::generateIn(shared_ptr <bodyPart> parent) const
|
||||
}
|
||||
|
||||
|
||||
void defaultAttachment::generatePart(shared_ptr <bodyPart> part) const
|
||||
void defaultAttachment::generatePart(const shared_ptr <bodyPart>& part) const
|
||||
{
|
||||
// Set header fields
|
||||
part->getHeader()->ContentType()->setValue(m_type);
|
||||
|
@ -45,8 +45,8 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
defaultAttachment(shared_ptr <const contentHandler> data, const encoding& enc, const mediaType& type, const text& desc = NULL_TEXT, const word& name = NULL_WORD);
|
||||
defaultAttachment(shared_ptr <const contentHandler> data, const mediaType& type, const text& desc = NULL_TEXT, const word& name = NULL_WORD);
|
||||
defaultAttachment(const shared_ptr <const contentHandler>& data, const encoding& enc, const mediaType& type, const text& desc = NULL_TEXT, const word& name = NULL_WORD);
|
||||
defaultAttachment(const shared_ptr <const contentHandler>& data, const mediaType& type, const text& desc = NULL_TEXT, const word& name = NULL_WORD);
|
||||
defaultAttachment(const defaultAttachment& attach);
|
||||
|
||||
~defaultAttachment();
|
||||
@ -74,11 +74,11 @@ protected:
|
||||
private:
|
||||
|
||||
// No need to override "generateIn", use "generatePart" instead (see below).
|
||||
void generateIn(shared_ptr <bodyPart> parent) const;
|
||||
void generateIn(const shared_ptr <bodyPart>& parent) const;
|
||||
|
||||
protected:
|
||||
|
||||
virtual void generatePart(shared_ptr <bodyPart> part) const;
|
||||
virtual void generatePart(const shared_ptr <bodyPart>& part) const;
|
||||
};
|
||||
|
||||
|
||||
|
@ -200,7 +200,7 @@ bool encoding::shouldReencode() const
|
||||
|
||||
|
||||
const encoding encoding::decide
|
||||
(shared_ptr <const contentHandler> data, const EncodingUsage usage)
|
||||
(const shared_ptr <const contentHandler>& data, const EncodingUsage usage)
|
||||
{
|
||||
// Do not re-encode data if it is already encoded
|
||||
if (data->isEncoded() && !data->getEncoding().shouldReencode())
|
||||
@ -231,7 +231,7 @@ const encoding encoding::decide
|
||||
}
|
||||
|
||||
|
||||
const encoding encoding::decide(shared_ptr <const contentHandler> data,
|
||||
const encoding encoding::decide(const shared_ptr <const contentHandler>& data,
|
||||
const charset& chset, const EncodingUsage usage)
|
||||
{
|
||||
// Do not re-encode data if it is already encoded
|
||||
|
@ -99,7 +99,7 @@ public:
|
||||
* @param usage context of use of data
|
||||
* @return suitable encoding for specified data
|
||||
*/
|
||||
static const encoding decide(shared_ptr <const contentHandler> data, const EncodingUsage usage = USAGE_BINARY_DATA);
|
||||
static const encoding decide(const shared_ptr <const contentHandler>& data, const EncodingUsage usage = USAGE_BINARY_DATA);
|
||||
|
||||
/** Decide which encoding to use based on the specified data and charset.
|
||||
*
|
||||
@ -108,7 +108,7 @@ public:
|
||||
* @param usage context of use of data
|
||||
* @return suitable encoding for specified data and charset
|
||||
*/
|
||||
static const encoding decide(shared_ptr <const contentHandler> data, const charset& chset, const EncodingUsage usage = USAGE_BINARY_DATA);
|
||||
static const encoding decide(const shared_ptr <const contentHandler>& data, const charset& chset, const EncodingUsage usage = USAGE_BINARY_DATA);
|
||||
|
||||
|
||||
shared_ptr <component> clone() const;
|
||||
|
@ -79,7 +79,7 @@ fileAttachment::fileAttachment(const string& filepath, const mediaType& type,
|
||||
}
|
||||
|
||||
|
||||
fileAttachment::fileAttachment(shared_ptr <contentHandler> cts, const word& filename, const mediaType& type)
|
||||
fileAttachment::fileAttachment(const shared_ptr <contentHandler>& cts, const word& filename, const mediaType& type)
|
||||
{
|
||||
if (!filename.isEmpty())
|
||||
m_fileInfo.setFilename(filename);
|
||||
@ -92,7 +92,7 @@ fileAttachment::fileAttachment(shared_ptr <contentHandler> cts, const word& file
|
||||
}
|
||||
|
||||
|
||||
fileAttachment::fileAttachment(shared_ptr <contentHandler> cts, const word& filename,
|
||||
fileAttachment::fileAttachment(const shared_ptr <contentHandler>& cts, const word& filename,
|
||||
const mediaType& type, const text& desc)
|
||||
{
|
||||
if (!filename.isEmpty())
|
||||
@ -107,7 +107,7 @@ fileAttachment::fileAttachment(shared_ptr <contentHandler> cts, const word& file
|
||||
}
|
||||
|
||||
|
||||
fileAttachment::fileAttachment(shared_ptr <contentHandler> cts, const word& filename,
|
||||
fileAttachment::fileAttachment(const shared_ptr <contentHandler>& cts, const word& filename,
|
||||
const mediaType& type, const text& desc, const encoding& enc)
|
||||
{
|
||||
if (!filename.isEmpty())
|
||||
@ -139,7 +139,7 @@ void fileAttachment::setData(const string& filepath)
|
||||
}
|
||||
|
||||
|
||||
void fileAttachment::setData(shared_ptr <contentHandler> cts)
|
||||
void fileAttachment::setData(const shared_ptr <contentHandler>& cts)
|
||||
{
|
||||
m_data = cts;
|
||||
|
||||
@ -147,7 +147,7 @@ void fileAttachment::setData(shared_ptr <contentHandler> cts)
|
||||
}
|
||||
|
||||
|
||||
void fileAttachment::generatePart(shared_ptr <bodyPart> part) const
|
||||
void fileAttachment::generatePart(const shared_ptr <bodyPart>& part) const
|
||||
{
|
||||
defaultAttachment::generatePart(part);
|
||||
|
||||
|
@ -52,9 +52,9 @@ public:
|
||||
fileAttachment(const string& filepath, const mediaType& type, const text& desc);
|
||||
fileAttachment(const string& filepath, const mediaType& type, const text& desc, const encoding& enc);
|
||||
|
||||
fileAttachment(shared_ptr <contentHandler> cts, const word& filename, const mediaType& type);
|
||||
fileAttachment(shared_ptr <contentHandler> cts, const word& filename, const mediaType& type, const text& desc);
|
||||
fileAttachment(shared_ptr <contentHandler> cts, const word& filename, const mediaType& type, const text& desc, const encoding& enc);
|
||||
fileAttachment(const shared_ptr <contentHandler>& cts, const word& filename, const mediaType& type);
|
||||
fileAttachment(const shared_ptr <contentHandler>& cts, const word& filename, const mediaType& type, const text& desc);
|
||||
fileAttachment(const shared_ptr <contentHandler>& cts, const word& filename, const mediaType& type, const text& desc, const encoding& enc);
|
||||
|
||||
/** Stores information about a file attachment.
|
||||
*/
|
||||
@ -181,11 +181,11 @@ public:
|
||||
private:
|
||||
|
||||
void setData(const string& filepath);
|
||||
void setData(shared_ptr <contentHandler> cts);
|
||||
void setData(const shared_ptr <contentHandler>& cts);
|
||||
|
||||
fileInfo m_fileInfo;
|
||||
|
||||
void generatePart(shared_ptr <bodyPart> part) const;
|
||||
void generatePart(const shared_ptr <bodyPart>& part) const;
|
||||
};
|
||||
|
||||
|
||||
|
@ -41,7 +41,7 @@ fileContentHandler::fileContentHandler()
|
||||
|
||||
|
||||
fileContentHandler::fileContentHandler
|
||||
(shared_ptr <utility::file> file, const vmime::encoding& enc)
|
||||
(const shared_ptr <utility::file>& file, const vmime::encoding& enc)
|
||||
{
|
||||
setData(file, enc);
|
||||
}
|
||||
@ -74,7 +74,7 @@ shared_ptr <contentHandler> fileContentHandler::clone() const
|
||||
|
||||
|
||||
void fileContentHandler::setData
|
||||
(shared_ptr <utility::file> file, const vmime::encoding& enc)
|
||||
(const shared_ptr <utility::file>& file, const vmime::encoding& enc)
|
||||
{
|
||||
m_file = file;
|
||||
m_encoding = enc;
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
* @return a reference to a new content handler
|
||||
*/
|
||||
fileContentHandler
|
||||
(shared_ptr <utility::file> file,
|
||||
(const shared_ptr <utility::file>& file,
|
||||
const vmime::encoding& enc = NO_ENCODING);
|
||||
|
||||
~fileContentHandler();
|
||||
@ -79,7 +79,7 @@ public:
|
||||
* in the file is already encoded with the specified encoding
|
||||
*/
|
||||
void setData
|
||||
(shared_ptr <utility::file> file,
|
||||
(const shared_ptr <utility::file>& file,
|
||||
const vmime::encoding& enc = NO_ENCODING);
|
||||
|
||||
private:
|
||||
|
@ -30,7 +30,7 @@ namespace vmime
|
||||
{
|
||||
|
||||
|
||||
generatedMessageAttachment::generatedMessageAttachment(shared_ptr <const bodyPart> part)
|
||||
generatedMessageAttachment::generatedMessageAttachment(const shared_ptr <const bodyPart>& part)
|
||||
: m_bpa(make_shared <bodyPartAttachment>(part))
|
||||
{
|
||||
}
|
||||
@ -97,7 +97,7 @@ shared_ptr <message> generatedMessageAttachment::getMessage() const
|
||||
}
|
||||
|
||||
|
||||
void generatedMessageAttachment::generateIn(shared_ptr <bodyPart> /* parent */) const
|
||||
void generatedMessageAttachment::generateIn(const shared_ptr <bodyPart>& /* parent */) const
|
||||
{
|
||||
// Not used (see 'parsedMessageAttachment')
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ class VMIME_EXPORT generatedMessageAttachment : public messageAttachment
|
||||
{
|
||||
public:
|
||||
|
||||
generatedMessageAttachment(shared_ptr <const bodyPart> part);
|
||||
generatedMessageAttachment(const shared_ptr <const bodyPart>& part);
|
||||
|
||||
const mediaType getType() const;
|
||||
const text getDescription() const;
|
||||
@ -60,7 +60,7 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
void generateIn(shared_ptr <bodyPart> parent) const;
|
||||
void generateIn(const shared_ptr <bodyPart>& parent) const;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -219,13 +219,13 @@ shared_ptr <headerField> header::getField(const string& fieldName)
|
||||
}
|
||||
|
||||
|
||||
void header::appendField(shared_ptr <headerField> field)
|
||||
void header::appendField(const shared_ptr <headerField>& field)
|
||||
{
|
||||
m_fields.push_back(field);
|
||||
}
|
||||
|
||||
|
||||
void header::insertFieldBefore(shared_ptr <headerField> beforeField, shared_ptr <headerField> field)
|
||||
void header::insertFieldBefore(const shared_ptr <headerField>& beforeField, const shared_ptr <headerField>& field)
|
||||
{
|
||||
const std::vector <shared_ptr <headerField> >::iterator it = std::find
|
||||
(m_fields.begin(), m_fields.end(), beforeField);
|
||||
@ -237,13 +237,13 @@ void header::insertFieldBefore(shared_ptr <headerField> beforeField, shared_ptr
|
||||
}
|
||||
|
||||
|
||||
void header::insertFieldBefore(const size_t pos, shared_ptr <headerField> field)
|
||||
void header::insertFieldBefore(const size_t pos, const shared_ptr <headerField>& field)
|
||||
{
|
||||
m_fields.insert(m_fields.begin() + pos, field);
|
||||
}
|
||||
|
||||
|
||||
void header::insertFieldAfter(shared_ptr <headerField> afterField, shared_ptr <headerField> field)
|
||||
void header::insertFieldAfter(const shared_ptr <headerField>& afterField, const shared_ptr <headerField>& field)
|
||||
{
|
||||
const std::vector <shared_ptr <headerField> >::iterator it = std::find
|
||||
(m_fields.begin(), m_fields.end(), afterField);
|
||||
@ -255,13 +255,13 @@ void header::insertFieldAfter(shared_ptr <headerField> afterField, shared_ptr <h
|
||||
}
|
||||
|
||||
|
||||
void header::insertFieldAfter(const size_t pos, shared_ptr <headerField> field)
|
||||
void header::insertFieldAfter(const size_t pos, const shared_ptr <headerField>& field)
|
||||
{
|
||||
m_fields.insert(m_fields.begin() + pos + 1, field);
|
||||
}
|
||||
|
||||
|
||||
void header::removeField(shared_ptr <headerField> field)
|
||||
void header::removeField(const shared_ptr <headerField>& field)
|
||||
{
|
||||
const std::vector <shared_ptr <headerField> >::iterator it = std::find
|
||||
(m_fields.begin(), m_fields.end(), field);
|
||||
@ -281,7 +281,7 @@ void header::removeField(const size_t pos)
|
||||
}
|
||||
|
||||
|
||||
void header::replaceField(shared_ptr <headerField> field, shared_ptr <headerField> newField)
|
||||
void header::replaceField(const shared_ptr <headerField>& field, const shared_ptr <headerField>& newField)
|
||||
{
|
||||
insertFieldBefore(field, newField);
|
||||
removeField(field);
|
||||
|
@ -185,7 +185,7 @@ public:
|
||||
*
|
||||
* @param field field to append
|
||||
*/
|
||||
void appendField(shared_ptr <headerField> field);
|
||||
void appendField(const shared_ptr <headerField>& field);
|
||||
|
||||
/** Insert a new field before the specified field.
|
||||
*
|
||||
@ -193,7 +193,7 @@ public:
|
||||
* @param field field to insert
|
||||
* @throw exceptions::no_such_field if the field is not in the list
|
||||
*/
|
||||
void insertFieldBefore(shared_ptr <headerField> beforeField, shared_ptr <headerField> field);
|
||||
void insertFieldBefore(const shared_ptr <headerField>& beforeField, const shared_ptr <headerField>& field);
|
||||
|
||||
/** Insert a new field before the specified position.
|
||||
*
|
||||
@ -201,7 +201,7 @@ public:
|
||||
* the beginning of the list)
|
||||
* @param field field to insert
|
||||
*/
|
||||
void insertFieldBefore(const size_t pos, shared_ptr <headerField> field);
|
||||
void insertFieldBefore(const size_t pos, const shared_ptr <headerField>& field);
|
||||
|
||||
/** Insert a new field after the specified field.
|
||||
*
|
||||
@ -209,21 +209,21 @@ public:
|
||||
* @param field field to insert
|
||||
* @throw exceptions::no_such_field if the field is not in the list
|
||||
*/
|
||||
void insertFieldAfter(shared_ptr <headerField> afterField, shared_ptr <headerField> field);
|
||||
void insertFieldAfter(const shared_ptr <headerField>& afterField, const shared_ptr <headerField>& field);
|
||||
|
||||
/** Insert a new field after the specified position.
|
||||
*
|
||||
* @param pos position of the field before the new field
|
||||
* @param field field to insert
|
||||
*/
|
||||
void insertFieldAfter(const size_t pos, shared_ptr <headerField> field);
|
||||
void insertFieldAfter(const size_t pos, const shared_ptr <headerField>& field);
|
||||
|
||||
/** Remove the specified field from the list.
|
||||
*
|
||||
* @param field field to remove
|
||||
* @throw exceptions::no_such_field if the field is not in the list
|
||||
*/
|
||||
void removeField(shared_ptr <headerField> field);
|
||||
void removeField(const shared_ptr <headerField>& field);
|
||||
|
||||
/** Remove the field at the specified position.
|
||||
*
|
||||
@ -237,7 +237,7 @@ public:
|
||||
* @param newField field to replace with
|
||||
* @throw exceptions::no_such_field if the field is not in the list
|
||||
*/
|
||||
void replaceField(shared_ptr <headerField> field, shared_ptr <headerField> newField);
|
||||
void replaceField(const shared_ptr <headerField>& field, const shared_ptr <headerField>& newField);
|
||||
|
||||
/** Remove all fields from the list.
|
||||
*/
|
||||
|
@ -300,7 +300,7 @@ shared_ptr <headerFieldValue> headerField::getValue()
|
||||
}
|
||||
|
||||
|
||||
void headerField::setValue(shared_ptr <headerFieldValue> value)
|
||||
void headerField::setValue(const shared_ptr <headerFieldValue>& value)
|
||||
{
|
||||
if (!headerFieldFactory::getInstance()->isValueTypeValid(*this, *value))
|
||||
throw exceptions::bad_field_value_type(getName());
|
||||
@ -310,7 +310,7 @@ void headerField::setValue(shared_ptr <headerFieldValue> value)
|
||||
}
|
||||
|
||||
|
||||
void headerField::setValueConst(shared_ptr <const headerFieldValue> value)
|
||||
void headerField::setValueConst(const shared_ptr <const headerFieldValue>& value)
|
||||
{
|
||||
if (!headerFieldFactory::getInstance()->isValueTypeValid(*this, *value))
|
||||
throw exceptions::bad_field_value_type(getName());
|
||||
|
@ -118,7 +118,7 @@ public:
|
||||
* valid for this header field
|
||||
* @param value new value
|
||||
*/
|
||||
virtual void setValue(shared_ptr <headerFieldValue> value);
|
||||
virtual void setValue(const shared_ptr <headerFieldValue>& value);
|
||||
|
||||
/** Set the value of this field by cloning the specified value.
|
||||
*
|
||||
@ -126,7 +126,7 @@ public:
|
||||
* valid for this header field
|
||||
* @param value new value
|
||||
*/
|
||||
virtual void setValueConst(shared_ptr <const headerFieldValue> value);
|
||||
virtual void setValueConst(const shared_ptr <const headerFieldValue>& value);
|
||||
|
||||
/** Set the value of this field (reference version).
|
||||
* The value will be cloned.
|
||||
|
@ -62,7 +62,7 @@ size_t htmlTextPart::getPartCount() const
|
||||
}
|
||||
|
||||
|
||||
void htmlTextPart::generateIn(shared_ptr <bodyPart> /* message */, shared_ptr <bodyPart> parent) const
|
||||
void htmlTextPart::generateIn(const shared_ptr <bodyPart>& /* message */, const shared_ptr <bodyPart>& parent) const
|
||||
{
|
||||
// Plain text
|
||||
if (!m_plainText->isEmpty())
|
||||
@ -182,7 +182,7 @@ void htmlTextPart::addEmbeddedObject(const bodyPart& part, const string& id,
|
||||
}
|
||||
|
||||
|
||||
void htmlTextPart::parse(shared_ptr <const bodyPart> message, shared_ptr <const bodyPart> parent, shared_ptr <const bodyPart> textPart)
|
||||
void htmlTextPart::parse(const shared_ptr <const bodyPart>& message, const shared_ptr <const bodyPart>& parent, const shared_ptr <const bodyPart>& textPart)
|
||||
{
|
||||
// Search for possible embedded objects in the _whole_ message.
|
||||
std::vector <shared_ptr <const bodyPart> > cidParts;
|
||||
@ -348,7 +348,7 @@ shared_ptr <const contentHandler> htmlTextPart::getPlainText() const
|
||||
}
|
||||
|
||||
|
||||
void htmlTextPart::setPlainText(shared_ptr <contentHandler> plainText)
|
||||
void htmlTextPart::setPlainText(const shared_ptr <contentHandler>& plainText)
|
||||
{
|
||||
m_plainText = plainText->clone();
|
||||
}
|
||||
@ -360,7 +360,7 @@ const shared_ptr <const contentHandler> htmlTextPart::getText() const
|
||||
}
|
||||
|
||||
|
||||
void htmlTextPart::setText(shared_ptr <contentHandler> text)
|
||||
void htmlTextPart::setText(const shared_ptr <contentHandler>& text)
|
||||
{
|
||||
m_text = text->clone();
|
||||
}
|
||||
@ -405,7 +405,7 @@ bool htmlTextPart::hasObject(const string& id) const
|
||||
|
||||
|
||||
shared_ptr <const htmlTextPart::embeddedObject> htmlTextPart::addObject
|
||||
(shared_ptr <contentHandler> data, const vmime::encoding& enc, const mediaType& type)
|
||||
(const shared_ptr <contentHandler>& data, const vmime::encoding& enc, const mediaType& type)
|
||||
{
|
||||
const messageId mid(messageId::generateId());
|
||||
|
||||
@ -419,7 +419,7 @@ shared_ptr <const htmlTextPart::embeddedObject> htmlTextPart::addObject
|
||||
|
||||
|
||||
shared_ptr <const htmlTextPart::embeddedObject> htmlTextPart::addObject
|
||||
(shared_ptr <contentHandler> data, const mediaType& type)
|
||||
(const shared_ptr <contentHandler>& data, const mediaType& type)
|
||||
{
|
||||
return addObject(data, encoding::decide(data), type);
|
||||
}
|
||||
@ -439,7 +439,7 @@ shared_ptr <const htmlTextPart::embeddedObject> htmlTextPart::addObject
|
||||
//
|
||||
|
||||
htmlTextPart::embeddedObject::embeddedObject
|
||||
(shared_ptr <contentHandler> data, const encoding& enc,
|
||||
(const shared_ptr <contentHandler>& data, const encoding& enc,
|
||||
const string& id, const mediaType& type, const ReferenceType refType)
|
||||
: m_data(vmime::clone(data)),
|
||||
m_encoding(enc), m_id(id), m_type(type), m_refType(refType)
|
||||
|
@ -52,10 +52,10 @@ public:
|
||||
void setCharset(const charset& ch);
|
||||
|
||||
shared_ptr <const contentHandler> getPlainText() const;
|
||||
void setPlainText(shared_ptr <contentHandler> plainText);
|
||||
void setPlainText(const shared_ptr <contentHandler>& plainText);
|
||||
|
||||
const shared_ptr <const contentHandler> getText() const;
|
||||
void setText(shared_ptr <contentHandler> text);
|
||||
void setText(const shared_ptr <contentHandler>& text);
|
||||
|
||||
/** Embedded object (eg: image for <IMG> tag).
|
||||
*/
|
||||
@ -79,7 +79,7 @@ public:
|
||||
* @param refType reference type
|
||||
* @return a reference to a new embedded object
|
||||
*/
|
||||
embeddedObject(shared_ptr <contentHandler> data, const encoding& enc,
|
||||
embeddedObject(const shared_ptr <contentHandler>& data, const encoding& enc,
|
||||
const string& id, const mediaType& type,
|
||||
const ReferenceType refType);
|
||||
|
||||
@ -196,7 +196,7 @@ public:
|
||||
* @return an unique object identifier used to identify the new
|
||||
* object among all other embedded objects
|
||||
*/
|
||||
shared_ptr <const embeddedObject> addObject(shared_ptr <contentHandler> data, const mediaType& type);
|
||||
shared_ptr <const embeddedObject> addObject(const shared_ptr <contentHandler>& data, const mediaType& type);
|
||||
|
||||
/** Embed an object and returns a string which identifies it.
|
||||
* The returned identifier is suitable for use in the 'src' attribute
|
||||
@ -208,13 +208,13 @@ public:
|
||||
* @return an unique object identifier used to identify the new
|
||||
* object among all other embedded objects
|
||||
*/
|
||||
shared_ptr <const embeddedObject> addObject(shared_ptr <contentHandler> data, const encoding& enc, const mediaType& type);
|
||||
shared_ptr <const embeddedObject> addObject(const shared_ptr <contentHandler>& data, const encoding& enc, const mediaType& type);
|
||||
|
||||
|
||||
size_t getPartCount() const;
|
||||
|
||||
void generateIn(shared_ptr <bodyPart> message, shared_ptr <bodyPart> parent) const;
|
||||
void parse(shared_ptr <const bodyPart> message, shared_ptr <const bodyPart> parent, shared_ptr <const bodyPart> textPart);
|
||||
void generateIn(const shared_ptr <bodyPart>& message, const shared_ptr <bodyPart>& parent) const;
|
||||
void parse(const shared_ptr <const bodyPart>& message, const shared_ptr <const bodyPart>& parent, const shared_ptr <const bodyPart>& textPart);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -246,13 +246,13 @@ bool mailboxGroup::isEmpty() const
|
||||
}
|
||||
|
||||
|
||||
void mailboxGroup::appendMailbox(shared_ptr <mailbox> mbox)
|
||||
void mailboxGroup::appendMailbox(const shared_ptr <mailbox>& mbox)
|
||||
{
|
||||
m_list.push_back(mbox);
|
||||
}
|
||||
|
||||
|
||||
void mailboxGroup::insertMailboxBefore(shared_ptr <mailbox> beforeMailbox, shared_ptr <mailbox> mbox)
|
||||
void mailboxGroup::insertMailboxBefore(const shared_ptr <mailbox>& beforeMailbox, const shared_ptr <mailbox>& mbox)
|
||||
{
|
||||
const std::vector <shared_ptr <mailbox> >::iterator it = std::find
|
||||
(m_list.begin(), m_list.end(), beforeMailbox);
|
||||
@ -264,7 +264,7 @@ void mailboxGroup::insertMailboxBefore(shared_ptr <mailbox> beforeMailbox, share
|
||||
}
|
||||
|
||||
|
||||
void mailboxGroup::insertMailboxBefore(const size_t pos, shared_ptr <mailbox> mbox)
|
||||
void mailboxGroup::insertMailboxBefore(const size_t pos, const shared_ptr <mailbox>& mbox)
|
||||
{
|
||||
if (pos >= m_list.size())
|
||||
throw std::out_of_range("Invalid position");
|
||||
@ -273,7 +273,7 @@ void mailboxGroup::insertMailboxBefore(const size_t pos, shared_ptr <mailbox> mb
|
||||
}
|
||||
|
||||
|
||||
void mailboxGroup::insertMailboxAfter(shared_ptr <mailbox> afterMailbox, shared_ptr <mailbox> mbox)
|
||||
void mailboxGroup::insertMailboxAfter(const shared_ptr <mailbox>& afterMailbox, const shared_ptr <mailbox>& mbox)
|
||||
{
|
||||
const std::vector <shared_ptr <mailbox> >::iterator it = std::find
|
||||
(m_list.begin(), m_list.end(), afterMailbox);
|
||||
@ -285,7 +285,7 @@ void mailboxGroup::insertMailboxAfter(shared_ptr <mailbox> afterMailbox, shared_
|
||||
}
|
||||
|
||||
|
||||
void mailboxGroup::insertMailboxAfter(const size_t pos, shared_ptr <mailbox> mbox)
|
||||
void mailboxGroup::insertMailboxAfter(const size_t pos, const shared_ptr <mailbox>& mbox)
|
||||
{
|
||||
if (pos >= m_list.size())
|
||||
throw std::out_of_range("Invalid position");
|
||||
@ -294,7 +294,7 @@ void mailboxGroup::insertMailboxAfter(const size_t pos, shared_ptr <mailbox> mbo
|
||||
}
|
||||
|
||||
|
||||
void mailboxGroup::removeMailbox(shared_ptr <mailbox> mbox)
|
||||
void mailboxGroup::removeMailbox(const shared_ptr <mailbox>& mbox)
|
||||
{
|
||||
const std::vector <shared_ptr <mailbox> >::iterator it = std::find
|
||||
(m_list.begin(), m_list.end(), mbox);
|
||||
|
@ -70,7 +70,7 @@ public:
|
||||
*
|
||||
* @param mbox mailbox to append
|
||||
*/
|
||||
void appendMailbox(shared_ptr <mailbox> mbox);
|
||||
void appendMailbox(const shared_ptr <mailbox>& mbox);
|
||||
|
||||
/** Insert a new mailbox before the specified mailbox.
|
||||
*
|
||||
@ -78,7 +78,7 @@ public:
|
||||
* @param mbox mailbox to insert
|
||||
* @throw std::out_of_range if the mailbox is not in the list
|
||||
*/
|
||||
void insertMailboxBefore(shared_ptr <mailbox> beforeMailbox, shared_ptr <mailbox> mbox);
|
||||
void insertMailboxBefore(const shared_ptr <mailbox>& beforeMailbox, const shared_ptr <mailbox>& mbox);
|
||||
|
||||
/** Insert a new mailbox before the specified position.
|
||||
*
|
||||
@ -87,7 +87,7 @@ public:
|
||||
* @param mbox mailbox to insert
|
||||
* @throw std::out_of_range if the position is out of range
|
||||
*/
|
||||
void insertMailboxBefore(const size_t pos, shared_ptr <mailbox> mbox);
|
||||
void insertMailboxBefore(const size_t pos, const shared_ptr <mailbox>& mbox);
|
||||
|
||||
/** Insert a new mailbox after the specified mailbox.
|
||||
*
|
||||
@ -95,7 +95,7 @@ public:
|
||||
* @param mbox mailbox to insert
|
||||
* @throw std::out_of_range if the mailbox is not in the list
|
||||
*/
|
||||
void insertMailboxAfter(shared_ptr <mailbox> afterMailbox, shared_ptr <mailbox> mbox);
|
||||
void insertMailboxAfter(const shared_ptr <mailbox>& afterMailbox, const shared_ptr <mailbox>& mbox);
|
||||
|
||||
/** Insert a new mailbox after the specified position.
|
||||
*
|
||||
@ -103,14 +103,14 @@ public:
|
||||
* @param mbox mailbox to insert
|
||||
* @throw std::out_of_range if the position is out of range
|
||||
*/
|
||||
void insertMailboxAfter(const size_t pos, shared_ptr <mailbox> mbox);
|
||||
void insertMailboxAfter(const size_t pos, const shared_ptr <mailbox>& mbox);
|
||||
|
||||
/** Remove the specified mailbox from the list.
|
||||
*
|
||||
* @param mbox mailbox to remove
|
||||
* @throw std::out_of_range if the mailbox is not in the list
|
||||
*/
|
||||
void removeMailbox(shared_ptr <mailbox> mbox);
|
||||
void removeMailbox(const shared_ptr <mailbox>& mbox);
|
||||
|
||||
/** Remove the mailbox at the specified position.
|
||||
*
|
||||
|
@ -41,37 +41,37 @@ mailboxList::mailboxList(const mailboxList& mboxList)
|
||||
}
|
||||
|
||||
|
||||
void mailboxList::appendMailbox(shared_ptr <mailbox> mbox)
|
||||
void mailboxList::appendMailbox(const shared_ptr <mailbox>& mbox)
|
||||
{
|
||||
m_list.appendAddress(mbox);
|
||||
}
|
||||
|
||||
|
||||
void mailboxList::insertMailboxBefore(shared_ptr <mailbox> beforeMailbox, shared_ptr <mailbox> mbox)
|
||||
void mailboxList::insertMailboxBefore(const shared_ptr <mailbox>& beforeMailbox, const shared_ptr <mailbox>& mbox)
|
||||
{
|
||||
m_list.insertAddressBefore(beforeMailbox, mbox);
|
||||
}
|
||||
|
||||
|
||||
void mailboxList::insertMailboxBefore(const size_t pos, shared_ptr <mailbox> mbox)
|
||||
void mailboxList::insertMailboxBefore(const size_t pos, const shared_ptr <mailbox>& mbox)
|
||||
{
|
||||
m_list.insertAddressBefore(pos, mbox);
|
||||
}
|
||||
|
||||
|
||||
void mailboxList::insertMailboxAfter(shared_ptr <mailbox> afterMailbox, shared_ptr <mailbox> mbox)
|
||||
void mailboxList::insertMailboxAfter(const shared_ptr <mailbox>& afterMailbox, const shared_ptr <mailbox>& mbox)
|
||||
{
|
||||
m_list.insertAddressAfter(afterMailbox, mbox);
|
||||
}
|
||||
|
||||
|
||||
void mailboxList::insertMailboxAfter(const size_t pos, shared_ptr <mailbox> mbox)
|
||||
void mailboxList::insertMailboxAfter(const size_t pos, const shared_ptr <mailbox>& mbox)
|
||||
{
|
||||
m_list.insertAddressAfter(pos, mbox);
|
||||
}
|
||||
|
||||
|
||||
void mailboxList::removeMailbox(shared_ptr <mailbox> mbox)
|
||||
void mailboxList::removeMailbox(const shared_ptr <mailbox>& mbox)
|
||||
{
|
||||
m_list.removeAddress(mbox);
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ public:
|
||||
*
|
||||
* @param mbox mailbox to append
|
||||
*/
|
||||
void appendMailbox(shared_ptr <mailbox> mbox);
|
||||
void appendMailbox(const shared_ptr <mailbox>& mbox);
|
||||
|
||||
/** Insert a new mailbox before the specified mailbox.
|
||||
*
|
||||
@ -65,7 +65,7 @@ public:
|
||||
* @param mbox mailbox to insert
|
||||
* @throw std::out_of_range if the mailbox is not in the list
|
||||
*/
|
||||
void insertMailboxBefore(shared_ptr <mailbox> beforeMailbox, shared_ptr <mailbox> mbox);
|
||||
void insertMailboxBefore(const shared_ptr <mailbox>& beforeMailbox, const shared_ptr <mailbox>& mbox);
|
||||
|
||||
/** Insert a new mailbox before the specified position.
|
||||
*
|
||||
@ -74,7 +74,7 @@ public:
|
||||
* @param mbox mailbox to insert
|
||||
* @throw std::out_of_range if the position is out of range
|
||||
*/
|
||||
void insertMailboxBefore(const size_t pos, shared_ptr <mailbox> mbox);
|
||||
void insertMailboxBefore(const size_t pos, const shared_ptr <mailbox>& mbox);
|
||||
|
||||
/** Insert a new mailbox after the specified mailbox.
|
||||
*
|
||||
@ -82,7 +82,7 @@ public:
|
||||
* @param mbox mailbox to insert
|
||||
* @throw std::out_of_range if the mailbox is not in the list
|
||||
*/
|
||||
void insertMailboxAfter(shared_ptr <mailbox> afterMailbox, shared_ptr <mailbox> mbox);
|
||||
void insertMailboxAfter(const shared_ptr <mailbox>& afterMailbox, const shared_ptr <mailbox>& mbox);
|
||||
|
||||
/** Insert a new mailbox after the specified position.
|
||||
*
|
||||
@ -90,14 +90,14 @@ public:
|
||||
* @param mbox mailbox to insert
|
||||
* @throw std::out_of_range if the position is out of range
|
||||
*/
|
||||
void insertMailboxAfter(const size_t pos, shared_ptr <mailbox> mbox);
|
||||
void insertMailboxAfter(const size_t pos, const shared_ptr <mailbox>& mbox);
|
||||
|
||||
/** Remove the specified mailbox from the list.
|
||||
*
|
||||
* @param mbox mailbox to remove
|
||||
* @throw std::out_of_range if the mailbox is not in the list
|
||||
*/
|
||||
void removeMailbox(shared_ptr <mailbox> mbox);
|
||||
void removeMailbox(const shared_ptr <mailbox>& mbox);
|
||||
|
||||
/** Remove the mailbox at the specified position.
|
||||
*
|
||||
|
@ -38,7 +38,7 @@ namespace vmime {
|
||||
namespace mdn {
|
||||
|
||||
|
||||
void MDNHelper::attachMDNRequest(shared_ptr <message> msg, const mailboxList& mailboxes)
|
||||
void MDNHelper::attachMDNRequest(const shared_ptr <message>& msg, const mailboxList& mailboxes)
|
||||
{
|
||||
shared_ptr <header> hdr = msg->getHeader();
|
||||
|
||||
@ -46,7 +46,7 @@ void MDNHelper::attachMDNRequest(shared_ptr <message> msg, const mailboxList& ma
|
||||
}
|
||||
|
||||
|
||||
void MDNHelper::attachMDNRequest(shared_ptr <message> msg, const mailbox& mbox)
|
||||
void MDNHelper::attachMDNRequest(const shared_ptr <message>& msg, const mailbox& mbox)
|
||||
{
|
||||
mailboxList mboxList;
|
||||
mboxList.appendMailbox(vmime::clone(mbox));
|
||||
@ -55,7 +55,7 @@ void MDNHelper::attachMDNRequest(shared_ptr <message> msg, const mailbox& mbox)
|
||||
}
|
||||
|
||||
|
||||
const std::vector <sendableMDNInfos> MDNHelper::getPossibleMDNs(const shared_ptr <const message> msg)
|
||||
const std::vector <sendableMDNInfos> MDNHelper::getPossibleMDNs(const shared_ptr <const message>& msg)
|
||||
{
|
||||
std::vector <sendableMDNInfos> result;
|
||||
|
||||
@ -74,7 +74,7 @@ const std::vector <sendableMDNInfos> MDNHelper::getPossibleMDNs(const shared_ptr
|
||||
}
|
||||
|
||||
|
||||
bool MDNHelper::isMDN(const shared_ptr <const message> msg)
|
||||
bool MDNHelper::isMDN(const shared_ptr <const message>& msg)
|
||||
{
|
||||
const shared_ptr <const header> hdr = msg->getHeader();
|
||||
|
||||
@ -103,7 +103,7 @@ bool MDNHelper::isMDN(const shared_ptr <const message> msg)
|
||||
}
|
||||
|
||||
|
||||
receivedMDNInfos MDNHelper::getReceivedMDN(const shared_ptr <const message> msg)
|
||||
receivedMDNInfos MDNHelper::getReceivedMDN(const shared_ptr <const message>& msg)
|
||||
{
|
||||
if (!isMDN(msg))
|
||||
throw exceptions::invalid_argument();
|
||||
@ -112,7 +112,7 @@ receivedMDNInfos MDNHelper::getReceivedMDN(const shared_ptr <const message> msg)
|
||||
}
|
||||
|
||||
|
||||
bool MDNHelper::needConfirmation(const shared_ptr <const message> msg)
|
||||
bool MDNHelper::needConfirmation(const shared_ptr <const message>& msg)
|
||||
{
|
||||
shared_ptr <const header> hdr = msg->getHeader();
|
||||
|
||||
|
@ -48,14 +48,14 @@ public:
|
||||
* @param msg message in which to add a MDN request
|
||||
* @param mailboxes list of mailboxes to which the MDN will be sent
|
||||
*/
|
||||
static void attachMDNRequest(shared_ptr <message> msg, const mailboxList& mailboxes);
|
||||
static void attachMDNRequest(const shared_ptr <message>& msg, const mailboxList& mailboxes);
|
||||
|
||||
/** Attach a MDN request to the specified message.
|
||||
*
|
||||
* @param msg message in which to add a MDN request
|
||||
* @param mbox mailbox to which the MDN will be sent
|
||||
*/
|
||||
static void attachMDNRequest(shared_ptr <message> msg, const mailbox& mbox);
|
||||
static void attachMDNRequest(const shared_ptr <message>& msg, const mailbox& mbox);
|
||||
|
||||
/** Return a list of possible MDNs that can be generated
|
||||
* for the specified message.
|
||||
@ -63,14 +63,14 @@ public:
|
||||
* @param msg message for which to send a MDN
|
||||
* @return list of possible MDNs
|
||||
*/
|
||||
static const std::vector <sendableMDNInfos> getPossibleMDNs(const shared_ptr <const message> msg);
|
||||
static const std::vector <sendableMDNInfos> getPossibleMDNs(const shared_ptr <const message>& msg);
|
||||
|
||||
/** Test whether the specified message is a MDN.
|
||||
*
|
||||
* @param msg message
|
||||
* @return true if the message is a MDN, false otherwise
|
||||
*/
|
||||
static bool isMDN(const shared_ptr <const message> msg);
|
||||
static bool isMDN(const shared_ptr <const message>& msg);
|
||||
|
||||
/** If the specified message is a MDN, return information
|
||||
* about it.
|
||||
@ -79,7 +79,7 @@ public:
|
||||
* @throw exceptions::invalid_argument if the message is not a MDN
|
||||
* @return information about the MDN
|
||||
*/
|
||||
static receivedMDNInfos getReceivedMDN(const shared_ptr <const message> msg);
|
||||
static receivedMDNInfos getReceivedMDN(const shared_ptr <const message>& msg);
|
||||
|
||||
/** Check whether we need user confirmation for sending a MDN even
|
||||
* if he/she explicitely allowed automatic send of MDNs. This can
|
||||
@ -88,7 +88,7 @@ public:
|
||||
* @param msg message for which to send a MDN
|
||||
* @return true if user confirmation should be asked, false otherwise
|
||||
*/
|
||||
static bool needConfirmation(const shared_ptr <const message> msg);
|
||||
static bool needConfirmation(const shared_ptr <const message>& msg);
|
||||
|
||||
/** Build a new MDN for the message. The resulting MDN can then be
|
||||
* sent over SMTP transport service.
|
||||
|
@ -30,7 +30,7 @@ namespace vmime {
|
||||
namespace mdn {
|
||||
|
||||
|
||||
receivedMDNInfos::receivedMDNInfos(const shared_ptr <const message> msg)
|
||||
receivedMDNInfos::receivedMDNInfos(const shared_ptr <const message>& msg)
|
||||
: m_msg(msg)
|
||||
{
|
||||
extract();
|
||||
|
@ -44,7 +44,7 @@ class VMIME_EXPORT receivedMDNInfos : public MDNInfos
|
||||
{
|
||||
public:
|
||||
|
||||
receivedMDNInfos(const shared_ptr <const message> msg);
|
||||
receivedMDNInfos(const shared_ptr <const message>& msg);
|
||||
receivedMDNInfos(const receivedMDNInfos& other);
|
||||
|
||||
receivedMDNInfos& operator=(const receivedMDNInfos& other);
|
||||
|
@ -28,7 +28,7 @@ namespace vmime {
|
||||
namespace mdn {
|
||||
|
||||
|
||||
sendableMDNInfos::sendableMDNInfos(const shared_ptr <const message> msg, const mailbox& mbox)
|
||||
sendableMDNInfos::sendableMDNInfos(const shared_ptr <const message>& msg, const mailbox& mbox)
|
||||
: m_msg(msg), m_mailbox(mbox)
|
||||
{
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ class VMIME_EXPORT sendableMDNInfos : public MDNInfos
|
||||
{
|
||||
public:
|
||||
|
||||
sendableMDNInfos(const shared_ptr <const message> msg, const mailbox& mbox);
|
||||
sendableMDNInfos(const shared_ptr <const message>& msg, const mailbox& mbox);
|
||||
sendableMDNInfos(const sendableMDNInfos& other);
|
||||
|
||||
sendableMDNInfos& operator=(const sendableMDNInfos& other);
|
||||
|
@ -167,13 +167,13 @@ shared_ptr <message> messageBuilder::construct() const
|
||||
}
|
||||
|
||||
|
||||
void messageBuilder::attach(shared_ptr <attachment> attach)
|
||||
void messageBuilder::attach(const shared_ptr <attachment>& attach)
|
||||
{
|
||||
appendAttachment(attach);
|
||||
}
|
||||
|
||||
|
||||
void messageBuilder::appendAttachment(shared_ptr <attachment> attach)
|
||||
void messageBuilder::appendAttachment(const shared_ptr <attachment>& attach)
|
||||
{
|
||||
m_attach.push_back(attach);
|
||||
}
|
||||
|
@ -136,13 +136,13 @@ public:
|
||||
*
|
||||
* @param attach new attachment
|
||||
*/
|
||||
void attach(shared_ptr <attachment> attach);
|
||||
void attach(const shared_ptr <attachment>& attach);
|
||||
|
||||
/** Attach a new object to the message.
|
||||
*
|
||||
* @param attach new attachment
|
||||
*/
|
||||
void appendAttachment(shared_ptr <attachment> attach);
|
||||
void appendAttachment(const shared_ptr <attachment>& attach);
|
||||
|
||||
/** Remove the attachment at the specified position.
|
||||
*
|
||||
|
@ -135,13 +135,13 @@ void messageIdSequence::generateImpl
|
||||
}
|
||||
|
||||
|
||||
void messageIdSequence::appendMessageId(shared_ptr <messageId> mid)
|
||||
void messageIdSequence::appendMessageId(const shared_ptr <messageId>& mid)
|
||||
{
|
||||
m_list.push_back(mid);
|
||||
}
|
||||
|
||||
|
||||
void messageIdSequence::insertMessageIdBefore(shared_ptr <messageId> beforeMid, shared_ptr <messageId> mid)
|
||||
void messageIdSequence::insertMessageIdBefore(const shared_ptr <messageId>& beforeMid, const shared_ptr <messageId>& mid)
|
||||
{
|
||||
const std::vector <shared_ptr <messageId> >::iterator it = std::find
|
||||
(m_list.begin(), m_list.end(), beforeMid);
|
||||
@ -153,13 +153,13 @@ void messageIdSequence::insertMessageIdBefore(shared_ptr <messageId> beforeMid,
|
||||
}
|
||||
|
||||
|
||||
void messageIdSequence::insertMessageIdBefore(const size_t pos, shared_ptr <messageId> mid)
|
||||
void messageIdSequence::insertMessageIdBefore(const size_t pos, const shared_ptr <messageId>& mid)
|
||||
{
|
||||
m_list.insert(m_list.begin() + pos, mid);
|
||||
}
|
||||
|
||||
|
||||
void messageIdSequence::insertMessageIdAfter(shared_ptr <messageId> afterMid, shared_ptr <messageId> mid)
|
||||
void messageIdSequence::insertMessageIdAfter(const shared_ptr <messageId>& afterMid, const shared_ptr <messageId>& mid)
|
||||
{
|
||||
const std::vector <shared_ptr <messageId> >::iterator it = std::find
|
||||
(m_list.begin(), m_list.end(), afterMid);
|
||||
@ -171,13 +171,13 @@ void messageIdSequence::insertMessageIdAfter(shared_ptr <messageId> afterMid, sh
|
||||
}
|
||||
|
||||
|
||||
void messageIdSequence::insertMessageIdAfter(const size_t pos, shared_ptr <messageId> mid)
|
||||
void messageIdSequence::insertMessageIdAfter(const size_t pos, const shared_ptr <messageId>& mid)
|
||||
{
|
||||
m_list.insert(m_list.begin() + pos + 1, mid);
|
||||
}
|
||||
|
||||
|
||||
void messageIdSequence::removeMessageId(shared_ptr <messageId> mid)
|
||||
void messageIdSequence::removeMessageId(const shared_ptr <messageId>& mid)
|
||||
{
|
||||
const std::vector <shared_ptr <messageId> >::iterator it = std::find
|
||||
(m_list.begin(), m_list.end(), mid);
|
||||
|
@ -56,7 +56,7 @@ public:
|
||||
*
|
||||
* @param mid message-id to append
|
||||
*/
|
||||
void appendMessageId(shared_ptr <messageId> mid);
|
||||
void appendMessageId(const shared_ptr <messageId>& mid);
|
||||
|
||||
/** Insert a new message-id before the specified message-id.
|
||||
*
|
||||
@ -64,7 +64,7 @@ public:
|
||||
* @param mid message-id to insert
|
||||
* @throw exceptions::no_such_messageid if the message-id is not in the list
|
||||
*/
|
||||
void insertMessageIdBefore(shared_ptr <messageId> beforeMid, shared_ptr <messageId> mid);
|
||||
void insertMessageIdBefore(const shared_ptr <messageId>& beforeMid, const shared_ptr <messageId>& mid);
|
||||
|
||||
/** Insert a new message-id before the specified position.
|
||||
*
|
||||
@ -72,7 +72,7 @@ public:
|
||||
* the beginning of the list)
|
||||
* @param mid message-id to insert
|
||||
*/
|
||||
void insertMessageIdBefore(const size_t pos, shared_ptr <messageId> mid);
|
||||
void insertMessageIdBefore(const size_t pos, const shared_ptr <messageId>& mid);
|
||||
|
||||
/** Insert a new message-id after the specified message-id.
|
||||
*
|
||||
@ -80,21 +80,21 @@ public:
|
||||
* @param mid message-id to insert
|
||||
* @throw exceptions::no_such_message_id if the message-id is not in the list
|
||||
*/
|
||||
void insertMessageIdAfter(shared_ptr <messageId> afterMid, shared_ptr <messageId> mid);
|
||||
void insertMessageIdAfter(const shared_ptr <messageId>& afterMid, const shared_ptr <messageId>& mid);
|
||||
|
||||
/** Insert a new message-id after the specified position.
|
||||
*
|
||||
* @param pos position of the message-id before the new message-id
|
||||
* @param mid message-id to insert
|
||||
*/
|
||||
void insertMessageIdAfter(const size_t pos, shared_ptr <messageId> mid);
|
||||
void insertMessageIdAfter(const size_t pos, const shared_ptr <messageId>& mid);
|
||||
|
||||
/** Remove the specified message-id from the list.
|
||||
*
|
||||
* @param mid message-id to remove
|
||||
* @throw exceptions::no_such_message_id if the message-id is not in the list
|
||||
*/
|
||||
void removeMessageId(shared_ptr <messageId> mid);
|
||||
void removeMessageId(const shared_ptr <messageId>& mid);
|
||||
|
||||
/** Remove the message-id at the specified position.
|
||||
*
|
||||
|
@ -46,7 +46,7 @@ messageParser::messageParser(const string& buffer)
|
||||
}
|
||||
|
||||
|
||||
messageParser::messageParser(shared_ptr <const message> msg)
|
||||
messageParser::messageParser(const shared_ptr <const message>& msg)
|
||||
{
|
||||
parse(msg);
|
||||
}
|
||||
@ -57,7 +57,7 @@ messageParser::~messageParser()
|
||||
}
|
||||
|
||||
|
||||
void messageParser::parse(shared_ptr <const message> msg)
|
||||
void messageParser::parse(const shared_ptr <const message>& msg)
|
||||
{
|
||||
// Header fields (if field is present, copy its value, else do nothing)
|
||||
#ifndef VMIME_BUILDING_DOC
|
||||
@ -106,13 +106,13 @@ void messageParser::parse(shared_ptr <const message> msg)
|
||||
}
|
||||
|
||||
|
||||
void messageParser::findAttachments(shared_ptr <const message> msg)
|
||||
void messageParser::findAttachments(const shared_ptr <const message>& msg)
|
||||
{
|
||||
m_attach = attachmentHelper::findAttachmentsInMessage(msg);
|
||||
}
|
||||
|
||||
|
||||
void messageParser::findTextParts(shared_ptr <const bodyPart> msg, shared_ptr <const bodyPart> part)
|
||||
void messageParser::findTextParts(const shared_ptr <const bodyPart>& msg, const shared_ptr <const bodyPart>& part)
|
||||
{
|
||||
// Handle the case in which the message is not multipart: if the body part is
|
||||
// "text/*", take this part.
|
||||
@ -156,7 +156,7 @@ void messageParser::findTextParts(shared_ptr <const bodyPart> msg, shared_ptr <c
|
||||
}
|
||||
|
||||
|
||||
bool messageParser::findSubTextParts(shared_ptr <const bodyPart> msg, shared_ptr <const bodyPart> part)
|
||||
bool messageParser::findSubTextParts(const shared_ptr <const bodyPart>& msg, const shared_ptr <const bodyPart>& part)
|
||||
{
|
||||
// In general, all the text parts are contained in parallel in the same
|
||||
// parent part (or message).
|
||||
|
@ -49,7 +49,7 @@ class VMIME_EXPORT messageParser
|
||||
public:
|
||||
|
||||
messageParser(const string& buffer);
|
||||
messageParser(shared_ptr <const message> msg);
|
||||
messageParser(const shared_ptr <const message>& msg);
|
||||
~messageParser();
|
||||
|
||||
public:
|
||||
@ -144,12 +144,12 @@ private:
|
||||
|
||||
std::vector <shared_ptr <textPart> > m_textParts;
|
||||
|
||||
void parse(shared_ptr <const message> msg);
|
||||
void parse(const shared_ptr <const message>& msg);
|
||||
|
||||
void findAttachments(shared_ptr <const message> msg);
|
||||
void findAttachments(const shared_ptr <const message>& msg);
|
||||
|
||||
void findTextParts(shared_ptr <const bodyPart> msg, shared_ptr <const bodyPart> part);
|
||||
bool findSubTextParts(shared_ptr <const bodyPart> msg, shared_ptr <const bodyPart> part);
|
||||
void findTextParts(const shared_ptr <const bodyPart>& msg, const shared_ptr <const bodyPart>& part);
|
||||
bool findSubTextParts(const shared_ptr <const bodyPart>& msg, const shared_ptr <const bodyPart>& part);
|
||||
};
|
||||
|
||||
|
||||
|
@ -31,13 +31,13 @@ namespace vmime {
|
||||
namespace misc {
|
||||
|
||||
|
||||
void importanceHelper::resetImportance(shared_ptr <message> msg)
|
||||
void importanceHelper::resetImportance(const shared_ptr <message>& msg)
|
||||
{
|
||||
resetImportanceHeader(msg->getHeader());
|
||||
}
|
||||
|
||||
|
||||
void importanceHelper::resetImportanceHeader(shared_ptr <header> hdr)
|
||||
void importanceHelper::resetImportanceHeader(const shared_ptr <header>& hdr)
|
||||
{
|
||||
shared_ptr <headerField> fld;
|
||||
|
||||
@ -49,13 +49,13 @@ void importanceHelper::resetImportanceHeader(shared_ptr <header> hdr)
|
||||
}
|
||||
|
||||
|
||||
importanceHelper::Importance importanceHelper::getImportance(shared_ptr <const message> msg)
|
||||
importanceHelper::Importance importanceHelper::getImportance(const shared_ptr <const message>& msg)
|
||||
{
|
||||
return getImportanceHeader(msg->getHeader());
|
||||
}
|
||||
|
||||
|
||||
importanceHelper::Importance importanceHelper::getImportanceHeader(shared_ptr <const header> hdr)
|
||||
importanceHelper::Importance importanceHelper::getImportanceHeader(const shared_ptr <const header>& hdr)
|
||||
{
|
||||
// Try "X-Priority" field
|
||||
shared_ptr <const headerField> fld = hdr->findField("X-Priority");
|
||||
@ -113,13 +113,13 @@ importanceHelper::Importance importanceHelper::getImportanceHeader(shared_ptr <c
|
||||
}
|
||||
|
||||
|
||||
void importanceHelper::setImportance(shared_ptr <message> msg, const Importance i)
|
||||
void importanceHelper::setImportance(const shared_ptr <message>& msg, const Importance i)
|
||||
{
|
||||
setImportanceHeader(msg->getHeader(), i);
|
||||
}
|
||||
|
||||
|
||||
void importanceHelper::setImportanceHeader(shared_ptr <header> hdr, const Importance i)
|
||||
void importanceHelper::setImportanceHeader(const shared_ptr <header>& hdr, const Importance i)
|
||||
{
|
||||
// "X-Priority:" Field
|
||||
shared_ptr <headerField> fld = hdr->getField("X-Priority");
|
||||
|
@ -58,13 +58,13 @@ public:
|
||||
*
|
||||
* @param msg message on which to reset importance
|
||||
*/
|
||||
static void resetImportance(shared_ptr <message> msg);
|
||||
static void resetImportance(const shared_ptr <message>& msg);
|
||||
|
||||
/** Reset the importance of a message to the default importance.
|
||||
*
|
||||
* @param hdr message header on which to reset importance
|
||||
*/
|
||||
static void resetImportanceHeader(shared_ptr <header> hdr);
|
||||
static void resetImportanceHeader(const shared_ptr <header>& hdr);
|
||||
|
||||
/** Return the importance of the specified message.
|
||||
*
|
||||
@ -72,7 +72,7 @@ public:
|
||||
* @return importance of the message, or default importance is no
|
||||
* information about importance is given in the message
|
||||
*/
|
||||
static Importance getImportance(shared_ptr <const message> msg);
|
||||
static Importance getImportance(const shared_ptr <const message>& msg);
|
||||
|
||||
/** Return the importance of a message, given its header.
|
||||
*
|
||||
@ -80,21 +80,21 @@ public:
|
||||
* @return importance of the message, or default importance is no
|
||||
* information about importance is given in the message
|
||||
*/
|
||||
static Importance getImportanceHeader(shared_ptr <const header> hdr);
|
||||
static Importance getImportanceHeader(const shared_ptr <const header>& hdr);
|
||||
|
||||
/** Set the importance of the specified message.
|
||||
*
|
||||
* @param msg message on which to set importance
|
||||
* @param i new message importance
|
||||
*/
|
||||
static void setImportance(shared_ptr <message> msg, const Importance i);
|
||||
static void setImportance(const shared_ptr <message>& msg, const Importance i);
|
||||
|
||||
/** Set the importance of a message, given its header.
|
||||
*
|
||||
* @param hdr message header on which to set importance
|
||||
* @param i new message importance
|
||||
*/
|
||||
static void setImportanceHeader(shared_ptr <header> hdr, const Importance i);
|
||||
static void setImportanceHeader(const shared_ptr <header>& hdr, const Importance i);
|
||||
};
|
||||
|
||||
|
||||
|
@ -60,7 +60,7 @@ const char* messageCountEvent::EVENT_CLASS = "messageCountEvent";
|
||||
|
||||
|
||||
messageCountEvent::messageCountEvent
|
||||
(shared_ptr <folder> folder, const Types type, const std::vector <size_t>& nums)
|
||||
(const shared_ptr <folder>& folder, const Types type, const std::vector <size_t>& nums)
|
||||
: m_folder(folder), m_type(type)
|
||||
{
|
||||
m_nums.resize(nums.size());
|
||||
@ -96,7 +96,7 @@ const char* messageChangedEvent::EVENT_CLASS = "messageChangedEvent";
|
||||
|
||||
|
||||
messageChangedEvent::messageChangedEvent
|
||||
(shared_ptr <folder> folder, const Types type, const std::vector <size_t>& nums)
|
||||
(const shared_ptr <folder>& folder, const Types type, const std::vector <size_t>& nums)
|
||||
: m_folder(folder), m_type(type)
|
||||
{
|
||||
m_nums.resize(nums.size());
|
||||
@ -129,7 +129,7 @@ const char* folderEvent::EVENT_CLASS = "folderEvent";
|
||||
|
||||
|
||||
folderEvent::folderEvent
|
||||
(shared_ptr <folder> folder, const Types type,
|
||||
(const shared_ptr <folder>& folder, const Types type,
|
||||
const utility::path& oldPath, const utility::path& newPath)
|
||||
: m_folder(folder), m_type(type), m_oldPath(oldPath), m_newPath(newPath)
|
||||
{
|
||||
|
@ -75,7 +75,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
messageCountEvent(shared_ptr <folder> folder, const Types type, const std::vector <size_t>& nums);
|
||||
messageCountEvent(const shared_ptr <folder>& folder, const Types type, const std::vector <size_t>& nums);
|
||||
|
||||
/** Return the folder in which messages have been added/removed.
|
||||
*
|
||||
@ -123,8 +123,8 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
virtual void messagesAdded(shared_ptr <messageCountEvent> event) = 0;
|
||||
virtual void messagesRemoved(shared_ptr <messageCountEvent> event) = 0;
|
||||
virtual void messagesAdded(const shared_ptr <messageCountEvent>& event) = 0;
|
||||
virtual void messagesRemoved(const shared_ptr <messageCountEvent>& event) = 0;
|
||||
};
|
||||
|
||||
|
||||
@ -144,7 +144,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
messageChangedEvent(shared_ptr <folder> folder, const Types type, const std::vector <size_t>& nums);
|
||||
messageChangedEvent(const shared_ptr <folder>& folder, const Types type, const std::vector <size_t>& nums);
|
||||
|
||||
/** Return the folder in which messages have changed.
|
||||
*
|
||||
@ -192,7 +192,7 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
virtual void messageChanged(shared_ptr <messageChangedEvent> event) = 0;
|
||||
virtual void messageChanged(const shared_ptr <messageChangedEvent>& event) = 0;
|
||||
};
|
||||
|
||||
|
||||
@ -214,7 +214,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
folderEvent(shared_ptr <folder> folder, const Types type, const utility::path& oldPath, const utility::path& newPath);
|
||||
folderEvent(const shared_ptr <folder>& folder, const Types type, const utility::path& oldPath, const utility::path& newPath);
|
||||
|
||||
/** Return the folder on which the event occurred.
|
||||
*
|
||||
@ -257,9 +257,9 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
virtual void folderCreated(shared_ptr <folderEvent> event) = 0;
|
||||
virtual void folderRenamed(shared_ptr <folderEvent> event) = 0;
|
||||
virtual void folderDeleted(shared_ptr <folderEvent> event) = 0;
|
||||
virtual void folderCreated(const shared_ptr <folderEvent>& event) = 0;
|
||||
virtual void folderRenamed(const shared_ptr <folderEvent>& event) = 0;
|
||||
virtual void folderDeleted(const shared_ptr <folderEvent>& event) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
@ -60,7 +60,7 @@ void folder::removeMessageChangedListener(events::messageChangedListener* l)
|
||||
}
|
||||
|
||||
|
||||
void folder::notifyMessageChanged(shared_ptr <events::messageChangedEvent> event)
|
||||
void folder::notifyMessageChanged(const shared_ptr <events::messageChangedEvent>& event)
|
||||
{
|
||||
for (std::list <events::messageChangedListener*>::iterator
|
||||
it = m_messageChangedListeners.begin() ; it != m_messageChangedListeners.end() ; ++it)
|
||||
@ -82,7 +82,7 @@ void folder::removeMessageCountListener(events::messageCountListener* l)
|
||||
}
|
||||
|
||||
|
||||
void folder::notifyMessageCount(shared_ptr <events::messageCountEvent> event)
|
||||
void folder::notifyMessageCount(const shared_ptr <events::messageCountEvent>& event)
|
||||
{
|
||||
for (std::list <events::messageCountListener*>::iterator
|
||||
it = m_messageCountListeners.begin() ; it != m_messageCountListeners.end() ; ++it)
|
||||
@ -104,7 +104,7 @@ void folder::removeFolderListener(events::folderListener* l)
|
||||
}
|
||||
|
||||
|
||||
void folder::notifyFolder(shared_ptr <events::folderEvent> event)
|
||||
void folder::notifyFolder(const shared_ptr <events::folderEvent>& event)
|
||||
{
|
||||
for (std::list <events::folderListener*>::iterator
|
||||
it = m_folderListeners.begin() ; it != m_folderListeners.end() ; ++it)
|
||||
@ -114,7 +114,7 @@ void folder::notifyFolder(shared_ptr <events::folderEvent> event)
|
||||
}
|
||||
|
||||
|
||||
void folder::notifyEvent(shared_ptr <events::event> event)
|
||||
void folder::notifyEvent(const shared_ptr <events::event>& event)
|
||||
{
|
||||
if (event->getClass() == events::messageCountEvent::EVENT_CLASS)
|
||||
{
|
||||
|
@ -274,7 +274,7 @@ public:
|
||||
* @throw exceptions::net_exception if an error occurs
|
||||
*/
|
||||
virtual messageSet addMessage
|
||||
(shared_ptr <vmime::message> msg,
|
||||
(const shared_ptr <vmime::message>& msg,
|
||||
const int flags = -1,
|
||||
vmime::datetime* date = NULL,
|
||||
utility::progressListener* progress = NULL) = 0;
|
||||
@ -366,7 +366,7 @@ public:
|
||||
* @param attribs set of attributes to fetch
|
||||
* @throw exceptions::net_exception if an error occurs
|
||||
*/
|
||||
virtual void fetchMessage(shared_ptr <message> msg, const fetchAttributes& attribs) = 0;
|
||||
virtual void fetchMessage(const shared_ptr <message>& msg, const fetchAttributes& attribs) = 0;
|
||||
|
||||
/** Get new references to messages in this folder, given either their
|
||||
* sequence numbers or UIDs, and fetch objects for them at the same time.
|
||||
@ -408,10 +408,10 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
void notifyMessageChanged(shared_ptr <events::messageChangedEvent> event);
|
||||
void notifyMessageCount(shared_ptr <events::messageCountEvent> event);
|
||||
void notifyFolder(shared_ptr <events::folderEvent> event);
|
||||
void notifyEvent(shared_ptr <events::event> event);
|
||||
void notifyMessageChanged(const shared_ptr <events::messageChangedEvent>& event);
|
||||
void notifyMessageCount(const shared_ptr <events::messageCountEvent>& event);
|
||||
void notifyFolder(const shared_ptr <events::folderEvent>& event);
|
||||
void notifyEvent(const shared_ptr <events::event>& event);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -396,7 +396,7 @@ const string IMAPCommand::getTraceText() const
|
||||
}
|
||||
|
||||
|
||||
void IMAPCommand::send(shared_ptr <IMAPConnection> conn)
|
||||
void IMAPCommand::send(const shared_ptr <IMAPConnection>& conn)
|
||||
{
|
||||
conn->sendCommand(dynamicCast <IMAPCommand>(shared_from_this()));
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ public:
|
||||
*
|
||||
* @param conn connection onto which the command will be sent
|
||||
*/
|
||||
virtual void send(shared_ptr <IMAPConnection> conn);
|
||||
virtual void send(const shared_ptr <IMAPConnection>& conn);
|
||||
|
||||
/** Returns the full text of the command, including command name
|
||||
* and parameters (if any). This is the text that will be sent
|
||||
|
@ -66,7 +66,7 @@ namespace net {
|
||||
namespace imap {
|
||||
|
||||
|
||||
IMAPConnection::IMAPConnection(shared_ptr <IMAPStore> store, shared_ptr <security::authenticator> auth)
|
||||
IMAPConnection::IMAPConnection(const shared_ptr <IMAPStore>& store, const shared_ptr <security::authenticator>& auth)
|
||||
: m_store(store), m_auth(auth), m_socket(null), m_parser(null), m_tag(null),
|
||||
m_hierarchySeparator('\0'), m_state(STATE_NONE), m_timeoutHandler(null),
|
||||
m_secured(false), m_firstTag(true), m_capabilitiesFetched(false), m_noModSeq(false)
|
||||
@ -754,7 +754,7 @@ void IMAPConnection::initHierarchySeparator()
|
||||
}
|
||||
|
||||
|
||||
void IMAPConnection::sendCommand(shared_ptr <IMAPCommand> cmd)
|
||||
void IMAPConnection::sendCommand(const shared_ptr <IMAPCommand>& cmd)
|
||||
{
|
||||
if (!m_firstTag)
|
||||
++(*m_tag);
|
||||
@ -830,7 +830,7 @@ shared_ptr <const socket> IMAPConnection::getSocket() const
|
||||
}
|
||||
|
||||
|
||||
void IMAPConnection::setSocket(shared_ptr <socket> sok)
|
||||
void IMAPConnection::setSocket(const shared_ptr <socket>& sok)
|
||||
{
|
||||
m_socket = sok;
|
||||
m_parser->setSocket(sok);
|
||||
|
@ -56,7 +56,7 @@ class VMIME_EXPORT IMAPConnection : public object, public enable_shared_from_thi
|
||||
{
|
||||
public:
|
||||
|
||||
IMAPConnection(shared_ptr <IMAPStore> store, shared_ptr <security::authenticator> auth);
|
||||
IMAPConnection(const shared_ptr <IMAPStore>& store, const shared_ptr <security::authenticator>& auth);
|
||||
~IMAPConnection();
|
||||
|
||||
|
||||
@ -81,7 +81,7 @@ public:
|
||||
char hierarchySeparator() const;
|
||||
|
||||
|
||||
void sendCommand(shared_ptr <IMAPCommand> cmd);
|
||||
void sendCommand(const shared_ptr <IMAPCommand>& cmd);
|
||||
void sendRaw(const byte_t* buffer, const size_t count);
|
||||
|
||||
IMAPParser::response* readResponse(IMAPParser::literalHandler* lh = NULL);
|
||||
@ -104,7 +104,7 @@ public:
|
||||
shared_ptr <connectionInfos> getConnectionInfos() const;
|
||||
|
||||
shared_ptr <const socket> getSocket() const;
|
||||
void setSocket(shared_ptr <socket> sok);
|
||||
void setSocket(const shared_ptr <socket>& sok);
|
||||
|
||||
shared_ptr <tracer> getTracer();
|
||||
|
||||
|
@ -52,7 +52,7 @@ namespace net {
|
||||
namespace imap {
|
||||
|
||||
|
||||
IMAPFolder::IMAPFolder(const folder::path& path, shared_ptr <IMAPStore> store, shared_ptr <folderAttributes> attribs)
|
||||
IMAPFolder::IMAPFolder(const folder::path& path, const shared_ptr <IMAPStore>& store, const shared_ptr <folderAttributes>& attribs)
|
||||
: m_store(store), m_connection(store->connection()), m_path(path),
|
||||
m_name(path.isEmpty() ? folder::path::component("") : path.getLastComponent()), m_mode(-1),
|
||||
m_open(false), m_attribs(attribs)
|
||||
@ -837,7 +837,7 @@ void IMAPFolder::fetchMessages(std::vector <shared_ptr <message> >& msg, const f
|
||||
}
|
||||
|
||||
|
||||
void IMAPFolder::fetchMessage(shared_ptr <message> msg, const fetchAttributes& options)
|
||||
void IMAPFolder::fetchMessage(const shared_ptr <message>& msg, const fetchAttributes& options)
|
||||
{
|
||||
std::vector <shared_ptr <message> > msgs;
|
||||
msgs.push_back(msg);
|
||||
@ -1044,7 +1044,7 @@ void IMAPFolder::setMessageFlags(const messageSet& msgs, const int flags, const
|
||||
|
||||
|
||||
messageSet IMAPFolder::addMessage
|
||||
(shared_ptr <vmime::message> msg, const int flags,
|
||||
(const shared_ptr <vmime::message>& msg, const int flags,
|
||||
vmime::datetime* date, utility::progressListener* progress)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
|
@ -63,7 +63,7 @@ private:
|
||||
friend class IMAPMessage;
|
||||
|
||||
IMAPFolder(const IMAPFolder&);
|
||||
IMAPFolder(const folder::path& path, shared_ptr <IMAPStore> store, shared_ptr <folderAttributes> attribs);
|
||||
IMAPFolder(const folder::path& path, const shared_ptr <IMAPStore>& store, const shared_ptr <folderAttributes>& attribs);
|
||||
|
||||
public:
|
||||
|
||||
@ -103,7 +103,7 @@ public:
|
||||
void setMessageFlags(const messageSet& msgs, const int flags, const int mode = message::FLAG_MODE_SET);
|
||||
|
||||
messageSet addMessage
|
||||
(shared_ptr <vmime::message> msg,
|
||||
(const shared_ptr <vmime::message>& msg,
|
||||
const int flags = -1,
|
||||
vmime::datetime* date = NULL,
|
||||
utility::progressListener* progress = NULL);
|
||||
@ -131,7 +131,7 @@ public:
|
||||
|
||||
|
||||
void fetchMessages(std::vector <shared_ptr <message> >& msg, const fetchAttributes& options, utility::progressListener* progress = NULL);
|
||||
void fetchMessage(shared_ptr <message> msg, const fetchAttributes& options);
|
||||
void fetchMessage(const shared_ptr <message>& msg, const fetchAttributes& options);
|
||||
|
||||
std::vector <shared_ptr <message> > getAndFetchMessages
|
||||
(const messageSet& msgs, const fetchAttributes& attribs);
|
||||
|
@ -101,7 +101,7 @@ private:
|
||||
//
|
||||
|
||||
|
||||
IMAPMessage::IMAPMessage(shared_ptr <IMAPFolder> folder, const size_t num)
|
||||
IMAPMessage::IMAPMessage(const shared_ptr <IMAPFolder>& folder, const size_t num)
|
||||
: m_folder(folder), m_num(num), m_size(-1U), m_flags(FLAG_UNDEFINED),
|
||||
m_expunged(false), m_modseq(0), m_structure(null)
|
||||
{
|
||||
@ -109,7 +109,7 @@ IMAPMessage::IMAPMessage(shared_ptr <IMAPFolder> folder, const size_t num)
|
||||
}
|
||||
|
||||
|
||||
IMAPMessage::IMAPMessage(shared_ptr <IMAPFolder> folder, const size_t num, const uid& uid)
|
||||
IMAPMessage::IMAPMessage(const shared_ptr <IMAPFolder>& folder, const size_t num, const uid& uid)
|
||||
: m_folder(folder), m_num(num), m_size(-1), m_flags(FLAG_UNDEFINED),
|
||||
m_expunged(false), m_uid(uid), m_modseq(0), m_structure(null)
|
||||
{
|
||||
@ -225,7 +225,7 @@ void IMAPMessage::extract
|
||||
|
||||
|
||||
void IMAPMessage::extractPart
|
||||
(shared_ptr <const messagePart> p,
|
||||
(const shared_ptr <const messagePart>& p,
|
||||
utility::outputStream& os,
|
||||
utility::progressListener* progress,
|
||||
const size_t start, const size_t length,
|
||||
@ -241,7 +241,7 @@ void IMAPMessage::extractPart
|
||||
}
|
||||
|
||||
|
||||
void IMAPMessage::fetchPartHeader(shared_ptr <messagePart> p)
|
||||
void IMAPMessage::fetchPartHeader(const shared_ptr <messagePart>& p)
|
||||
{
|
||||
shared_ptr <IMAPFolder> folder = m_folder.lock();
|
||||
|
||||
@ -257,7 +257,7 @@ void IMAPMessage::fetchPartHeader(shared_ptr <messagePart> p)
|
||||
}
|
||||
|
||||
|
||||
void IMAPMessage::fetchPartHeaderForStructure(shared_ptr <messageStructure> str)
|
||||
void IMAPMessage::fetchPartHeaderForStructure(const shared_ptr <messageStructure>& str)
|
||||
{
|
||||
for (size_t i = 0, n = str->getPartCount() ; i < n ; ++i)
|
||||
{
|
||||
@ -273,7 +273,7 @@ void IMAPMessage::fetchPartHeaderForStructure(shared_ptr <messageStructure> str)
|
||||
|
||||
|
||||
size_t IMAPMessage::extractImpl
|
||||
(shared_ptr <const messagePart> p,
|
||||
(const shared_ptr <const messagePart>& p,
|
||||
utility::outputStream& os,
|
||||
utility::progressListener* progress,
|
||||
const size_t start, const size_t length,
|
||||
@ -611,7 +611,7 @@ void IMAPMessage::setFlags(const int flags, const int mode)
|
||||
|
||||
|
||||
void IMAPMessage::constructParsedMessage
|
||||
(shared_ptr <bodyPart> parentPart, shared_ptr <messageStructure> str, int level)
|
||||
(const shared_ptr <bodyPart>& parentPart, const shared_ptr <messageStructure>& str, int level)
|
||||
{
|
||||
if (level == 0)
|
||||
{
|
||||
|
@ -59,8 +59,8 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
IMAPMessage(shared_ptr <IMAPFolder> folder, const size_t num);
|
||||
IMAPMessage(shared_ptr <IMAPFolder> folder, const size_t num, const uid& uid);
|
||||
IMAPMessage(const shared_ptr <IMAPFolder>& folder, const size_t num);
|
||||
IMAPMessage(const shared_ptr <IMAPFolder>& folder, const size_t num, const uid& uid);
|
||||
|
||||
~IMAPMessage();
|
||||
|
||||
@ -99,13 +99,13 @@ public:
|
||||
const bool peek = false) const;
|
||||
|
||||
void extractPart
|
||||
(shared_ptr <const messagePart> p,
|
||||
(const shared_ptr <const messagePart>& p,
|
||||
utility::outputStream& os,
|
||||
utility::progressListener* progress = NULL,
|
||||
const size_t start = 0, const size_t length = -1,
|
||||
const bool peek = false) const;
|
||||
|
||||
void fetchPartHeader(shared_ptr <messagePart> p);
|
||||
void fetchPartHeader(const shared_ptr <messagePart>& p);
|
||||
|
||||
shared_ptr <vmime::message> getParsedMessage();
|
||||
|
||||
@ -135,7 +135,7 @@ private:
|
||||
*
|
||||
* @param str structure for which to fetch parts headers
|
||||
*/
|
||||
void fetchPartHeaderForStructure(shared_ptr <messageStructure> str);
|
||||
void fetchPartHeaderForStructure(const shared_ptr <messageStructure>& str);
|
||||
|
||||
/** Recursively contruct parsed message from structure.
|
||||
* Called by getParsedMessage().
|
||||
@ -144,7 +144,7 @@ private:
|
||||
* @param str structure for which to construct part
|
||||
* @param level current nesting level (0 is root)
|
||||
*/
|
||||
void constructParsedMessage(shared_ptr <bodyPart> parentPart, shared_ptr <messageStructure> str, int level = 0);
|
||||
void constructParsedMessage(const shared_ptr <bodyPart>& parentPart, const shared_ptr <messageStructure>& str, int level = 0);
|
||||
|
||||
|
||||
enum ExtractFlags
|
||||
@ -155,7 +155,7 @@ private:
|
||||
};
|
||||
|
||||
size_t extractImpl
|
||||
(shared_ptr <const messagePart> p,
|
||||
(const shared_ptr <const messagePart>& p,
|
||||
utility::outputStream& os,
|
||||
utility::progressListener* progress,
|
||||
const size_t start, const size_t length,
|
||||
|
@ -36,7 +36,7 @@ namespace net {
|
||||
namespace imap {
|
||||
|
||||
|
||||
IMAPMessagePart::IMAPMessagePart(shared_ptr <IMAPMessagePart> parent, const size_t number, const IMAPParser::body_type_mpart* mpart)
|
||||
IMAPMessagePart::IMAPMessagePart(const shared_ptr <IMAPMessagePart>& parent, const size_t number, const IMAPParser::body_type_mpart* mpart)
|
||||
: m_parent(parent), m_header(null), m_number(number), m_size(0)
|
||||
{
|
||||
m_mediaType = vmime::mediaType
|
||||
@ -44,7 +44,7 @@ IMAPMessagePart::IMAPMessagePart(shared_ptr <IMAPMessagePart> parent, const size
|
||||
}
|
||||
|
||||
|
||||
IMAPMessagePart::IMAPMessagePart(shared_ptr <IMAPMessagePart> parent, const size_t number, const IMAPParser::body_type_1part* part)
|
||||
IMAPMessagePart::IMAPMessagePart(const shared_ptr <IMAPMessagePart>& parent, const size_t number, const IMAPParser::body_type_1part* part)
|
||||
: m_parent(parent), m_header(null), m_number(number), m_size(0)
|
||||
{
|
||||
if (part->body_type_text())
|
||||
@ -127,7 +127,7 @@ shared_ptr <const header> IMAPMessagePart::getHeader() const
|
||||
|
||||
// static
|
||||
shared_ptr <IMAPMessagePart> IMAPMessagePart::create
|
||||
(shared_ptr <IMAPMessagePart> parent, const size_t number, const IMAPParser::body* body)
|
||||
(const shared_ptr <IMAPMessagePart>& parent, const size_t number, const IMAPParser::body* body)
|
||||
{
|
||||
if (body->body_type_mpart())
|
||||
{
|
||||
|
@ -48,8 +48,8 @@ class VMIME_EXPORT IMAPMessagePart : public messagePart
|
||||
{
|
||||
public:
|
||||
|
||||
IMAPMessagePart(shared_ptr <IMAPMessagePart> parent, const size_t number, const IMAPParser::body_type_mpart* mpart);
|
||||
IMAPMessagePart(shared_ptr <IMAPMessagePart> parent, const size_t number, const IMAPParser::body_type_1part* part);
|
||||
IMAPMessagePart(const shared_ptr <IMAPMessagePart>& parent, const size_t number, const IMAPParser::body_type_mpart* mpart);
|
||||
IMAPMessagePart(const shared_ptr <IMAPMessagePart>& parent, const size_t number, const IMAPParser::body_type_1part* part);
|
||||
|
||||
shared_ptr <const messageStructure> getStructure() const;
|
||||
shared_ptr <messageStructure> getStructure();
|
||||
@ -64,7 +64,7 @@ public:
|
||||
|
||||
|
||||
static shared_ptr <IMAPMessagePart> create
|
||||
(shared_ptr <IMAPMessagePart> parent, const size_t number, const IMAPParser::body* body);
|
||||
(const shared_ptr <IMAPMessagePart>& parent, const size_t number, const IMAPParser::body* body);
|
||||
|
||||
|
||||
header& getOrCreateHeader();
|
||||
|
@ -43,7 +43,7 @@ namespace imap {
|
||||
|
||||
|
||||
IMAPMessagePartContentHandler::IMAPMessagePartContentHandler
|
||||
(shared_ptr <IMAPMessage> msg, shared_ptr <messagePart> part, const vmime::encoding& encoding)
|
||||
(const shared_ptr <IMAPMessage>& msg, const shared_ptr <messagePart>& part, const vmime::encoding& encoding)
|
||||
: m_message(msg), m_part(part), m_encoding(encoding)
|
||||
{
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ class VMIME_EXPORT IMAPMessagePartContentHandler : public contentHandler
|
||||
{
|
||||
public:
|
||||
|
||||
IMAPMessagePartContentHandler(shared_ptr <IMAPMessage> msg, shared_ptr <messagePart> part, const vmime::encoding& encoding);
|
||||
IMAPMessagePartContentHandler(const shared_ptr <IMAPMessage>& msg, const shared_ptr <messagePart>& part, const vmime::encoding& encoding);
|
||||
|
||||
shared_ptr <contentHandler> clone() const;
|
||||
|
||||
|
@ -47,7 +47,7 @@ IMAPMessageStructure::IMAPMessageStructure(const IMAPParser::body* body)
|
||||
}
|
||||
|
||||
|
||||
IMAPMessageStructure::IMAPMessageStructure(shared_ptr <IMAPMessagePart> parent, const std::vector <IMAPParser::body*>& list)
|
||||
IMAPMessageStructure::IMAPMessageStructure(const shared_ptr <IMAPMessagePart>& parent, const std::vector <IMAPParser::body*>& list)
|
||||
{
|
||||
size_t number = 0;
|
||||
|
||||
|
@ -50,7 +50,7 @@ public:
|
||||
|
||||
IMAPMessageStructure();
|
||||
IMAPMessageStructure(const IMAPParser::body* body);
|
||||
IMAPMessageStructure(shared_ptr <IMAPMessagePart> parent, const std::vector <IMAPParser::body*>& list);
|
||||
IMAPMessageStructure(const shared_ptr <IMAPMessagePart>& parent, const std::vector <IMAPParser::body*>& list);
|
||||
|
||||
shared_ptr <const messagePart> getPartAt(const size_t x) const;
|
||||
shared_ptr <messagePart> getPartAt(const size_t x);
|
||||
|
@ -273,7 +273,7 @@ public:
|
||||
*
|
||||
* @param tag IMAP command tag
|
||||
*/
|
||||
void setTag(shared_ptr <IMAPTag> tag)
|
||||
void setTag(const shared_ptr <IMAPTag>& tag)
|
||||
{
|
||||
m_tag = tag;
|
||||
}
|
||||
@ -292,7 +292,7 @@ public:
|
||||
*
|
||||
* @param sok socket
|
||||
*/
|
||||
void setSocket(shared_ptr <socket> sok)
|
||||
void setSocket(const shared_ptr <socket>& sok)
|
||||
{
|
||||
m_socket = sok;
|
||||
}
|
||||
@ -301,7 +301,7 @@ public:
|
||||
*
|
||||
* @param toh timeout handler
|
||||
*/
|
||||
void setTimeoutHandler(shared_ptr <timeoutHandler> toh)
|
||||
void setTimeoutHandler(const shared_ptr <timeoutHandler>& toh)
|
||||
{
|
||||
m_timeoutHandler = toh;
|
||||
}
|
||||
@ -310,7 +310,7 @@ public:
|
||||
*
|
||||
* @param tr tracer
|
||||
*/
|
||||
void setTracer(shared_ptr <tracer> tr)
|
||||
void setTracer(const shared_ptr <tracer>& tr)
|
||||
{
|
||||
m_tracer = tr;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ namespace net {
|
||||
namespace imap {
|
||||
|
||||
|
||||
IMAPSStore::IMAPSStore(shared_ptr <session> sess, shared_ptr <security::authenticator> auth)
|
||||
IMAPSStore::IMAPSStore(const shared_ptr <session>& sess, const shared_ptr <security::authenticator>& auth)
|
||||
: IMAPStore(sess, auth, true)
|
||||
{
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ class VMIME_EXPORT IMAPSStore : public IMAPStore
|
||||
{
|
||||
public:
|
||||
|
||||
IMAPSStore(shared_ptr <session> sess, shared_ptr <security::authenticator> auth);
|
||||
IMAPSStore(const shared_ptr <session>& sess, const shared_ptr <security::authenticator>& auth);
|
||||
~IMAPSStore();
|
||||
|
||||
const string getProtocolName() const;
|
||||
|
@ -44,7 +44,7 @@ namespace net {
|
||||
namespace imap {
|
||||
|
||||
|
||||
IMAPStore::IMAPStore(shared_ptr <session> sess, shared_ptr <security::authenticator> auth, const bool secured)
|
||||
IMAPStore::IMAPStore(const shared_ptr <session>& sess, const shared_ptr <security::authenticator>& auth, const bool secured)
|
||||
: store(sess, getInfosInstance(), auth), m_connection(null), m_isIMAPS(secured)
|
||||
{
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ class VMIME_EXPORT IMAPStore : public store
|
||||
|
||||
public:
|
||||
|
||||
IMAPStore(shared_ptr <session> sess, shared_ptr <security::authenticator> auth, const bool secured = false);
|
||||
IMAPStore(const shared_ptr <session>& sess, const shared_ptr <security::authenticator>& auth, const bool secured = false);
|
||||
~IMAPStore();
|
||||
|
||||
const string getProtocolName() const;
|
||||
|
@ -381,7 +381,7 @@ const folder::path::component IMAPUtils::fromModifiedUTF7(const string& text)
|
||||
|
||||
// static
|
||||
void IMAPUtils::mailboxFlagsToFolderAttributes
|
||||
(shared_ptr <const IMAPConnection> cnt, const IMAPParser::mailbox_flag_list* list,
|
||||
(const shared_ptr <const IMAPConnection>& cnt, const IMAPParser::mailbox_flag_list* list,
|
||||
folderAttributes& attribs)
|
||||
{
|
||||
int specialUse = folderAttributes::SPECIALUSE_NONE;
|
||||
@ -594,7 +594,7 @@ const string IMAPUtils::dateTime(const vmime::datetime& date)
|
||||
|
||||
// static
|
||||
shared_ptr <IMAPCommand> IMAPUtils::buildFetchCommand
|
||||
(shared_ptr <IMAPConnection> cnt, const messageSet& msgs, const fetchAttributes& options)
|
||||
(const shared_ptr <IMAPConnection>& cnt, const messageSet& msgs, const fetchAttributes& options)
|
||||
{
|
||||
// Example:
|
||||
// C: A654 FETCH 2:4 (FLAGS BODY[HEADER.FIELDS (DATE FROM)])
|
||||
|
@ -74,7 +74,7 @@ public:
|
||||
* @param attribs reference to an object holding folder attributes
|
||||
*/
|
||||
static void mailboxFlagsToFolderAttributes
|
||||
(shared_ptr <const IMAPConnection> cnt,
|
||||
(const shared_ptr <const IMAPConnection>& cnt,
|
||||
const IMAPParser::mailbox_flag_list* list,
|
||||
folderAttributes& attribs);
|
||||
|
||||
@ -98,7 +98,7 @@ public:
|
||||
* @return fetch request
|
||||
*/
|
||||
static shared_ptr <IMAPCommand> buildFetchCommand
|
||||
(shared_ptr <IMAPConnection> cnt, const messageSet& msgs, const fetchAttributes& options);
|
||||
(const shared_ptr <IMAPConnection>& cnt, const messageSet& msgs, const fetchAttributes& options);
|
||||
|
||||
/** Convert a parser-style address list to a mailbox list.
|
||||
*
|
||||
@ -124,7 +124,7 @@ public:
|
||||
private:
|
||||
|
||||
static const string buildFetchRequestImpl
|
||||
(shared_ptr <IMAPConnection> cnt, const string& mode, const string& set, const int options);
|
||||
(const shared_ptr <IMAPConnection>& cnt, const string& mode, const string& set, const int options);
|
||||
};
|
||||
|
||||
|
||||
|
@ -41,7 +41,7 @@ namespace maildir {
|
||||
namespace format {
|
||||
|
||||
|
||||
courierMaildirFormat::courierMaildirFormat(shared_ptr <context> ctx)
|
||||
courierMaildirFormat::courierMaildirFormat(const shared_ptr <context>& ctx)
|
||||
: maildirFormat(ctx)
|
||||
{
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ class VMIME_EXPORT courierMaildirFormat : public maildirFormat
|
||||
{
|
||||
public:
|
||||
|
||||
courierMaildirFormat(shared_ptr <context> ctx);
|
||||
courierMaildirFormat(const shared_ptr <context>& ctx);
|
||||
|
||||
|
||||
/* Folder types:
|
||||
|
@ -41,7 +41,7 @@ namespace maildir {
|
||||
namespace format {
|
||||
|
||||
|
||||
kmailMaildirFormat::kmailMaildirFormat(shared_ptr <context> ctx)
|
||||
kmailMaildirFormat::kmailMaildirFormat(const shared_ptr <context>& ctx)
|
||||
: maildirFormat(ctx)
|
||||
{
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ class VMIME_EXPORT kmailMaildirFormat : public maildirFormat
|
||||
{
|
||||
public:
|
||||
|
||||
kmailMaildirFormat(shared_ptr <context> ctx);
|
||||
kmailMaildirFormat(const shared_ptr <context>& ctx);
|
||||
|
||||
|
||||
/* Folder types:
|
||||
|
@ -49,7 +49,7 @@ namespace net {
|
||||
namespace maildir {
|
||||
|
||||
|
||||
maildirFolder::maildirFolder(const folder::path& path, shared_ptr <maildirStore> store)
|
||||
maildirFolder::maildirFolder(const folder::path& path, const shared_ptr <maildirStore>& store)
|
||||
: m_store(store), m_path(path),
|
||||
m_name(path.isEmpty() ? folder::path::component("") : path.getLastComponent()),
|
||||
m_mode(-1), m_open(false), m_unreadMessageCount(0), m_messageCount(0)
|
||||
@ -708,7 +708,7 @@ void maildirFolder::setMessageFlags
|
||||
|
||||
|
||||
messageSet maildirFolder::addMessage
|
||||
(shared_ptr <vmime::message> msg, const int flags,
|
||||
(const shared_ptr <vmime::message>& msg, const int flags,
|
||||
vmime::datetime* date, utility::progressListener* progress)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -1221,7 +1221,7 @@ void maildirFolder::fetchMessages(std::vector <shared_ptr <message> >& msg,
|
||||
}
|
||||
|
||||
|
||||
void maildirFolder::fetchMessage(shared_ptr <message> msg, const fetchAttributes& options)
|
||||
void maildirFolder::fetchMessage(const shared_ptr <message>& msg, const fetchAttributes& options)
|
||||
{
|
||||
shared_ptr <maildirStore> store = m_store.lock();
|
||||
|
||||
|
@ -61,7 +61,7 @@ private:
|
||||
friend class maildirMessage;
|
||||
|
||||
maildirFolder(const maildirFolder&) : folder() { }
|
||||
maildirFolder(const folder::path& path, shared_ptr <maildirStore> store);
|
||||
maildirFolder(const folder::path& path, const shared_ptr <maildirStore>& store);
|
||||
|
||||
public:
|
||||
|
||||
@ -99,7 +99,7 @@ public:
|
||||
|
||||
void setMessageFlags(const messageSet& msgs, const int flags, const int mode = message::FLAG_MODE_SET);
|
||||
|
||||
messageSet addMessage(shared_ptr <vmime::message> msg, const int flags = -1, vmime::datetime* date = NULL, utility::progressListener* progress = NULL);
|
||||
messageSet addMessage(const shared_ptr <vmime::message>& msg, const int flags = -1, vmime::datetime* date = NULL, utility::progressListener* progress = NULL);
|
||||
messageSet addMessage(utility::inputStream& is, const size_t size, const int flags = -1, vmime::datetime* date = NULL, utility::progressListener* progress = NULL);
|
||||
|
||||
messageSet copyMessages(const folder::path& dest, const messageSet& msgs);
|
||||
@ -116,7 +116,7 @@ public:
|
||||
|
||||
|
||||
void fetchMessages(std::vector <shared_ptr <message> >& msg, const fetchAttributes& options, utility::progressListener* progress = NULL);
|
||||
void fetchMessage(shared_ptr <message> msg, const fetchAttributes& options);
|
||||
void fetchMessage(const shared_ptr <message>& msg, const fetchAttributes& options);
|
||||
|
||||
std::vector <shared_ptr <message> > getAndFetchMessages
|
||||
(const messageSet& msgs, const fetchAttributes& attribs);
|
||||
|
@ -50,7 +50,7 @@ const utility::file::path::component maildirFormat::NEW_DIR("new", vmime::charse
|
||||
// maildirFormat::context
|
||||
//
|
||||
|
||||
maildirFormat::context::context(shared_ptr <maildirStore> store)
|
||||
maildirFormat::context::context(const shared_ptr <maildirStore>& store)
|
||||
: m_store(store)
|
||||
{
|
||||
}
|
||||
@ -66,7 +66,7 @@ shared_ptr <maildirStore> maildirFormat::context::getStore() const
|
||||
// maildirFormat
|
||||
//
|
||||
|
||||
maildirFormat::maildirFormat(shared_ptr <context> ctx)
|
||||
maildirFormat::maildirFormat(const shared_ptr <context>& ctx)
|
||||
: m_context(ctx)
|
||||
{
|
||||
}
|
||||
@ -85,7 +85,7 @@ shared_ptr <const maildirFormat::context> maildirFormat::getContext() const
|
||||
|
||||
|
||||
// static
|
||||
shared_ptr <maildirFormat> maildirFormat::detect(shared_ptr <maildirStore> store)
|
||||
shared_ptr <maildirFormat> maildirFormat::detect(const shared_ptr <maildirStore>& store)
|
||||
{
|
||||
shared_ptr <context> ctx = make_shared <context>(store);
|
||||
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
{
|
||||
public:
|
||||
|
||||
context(shared_ptr <maildirStore> store);
|
||||
context(const shared_ptr <maildirStore>& store);
|
||||
|
||||
shared_ptr <maildirStore> getStore() const;
|
||||
|
||||
@ -146,7 +146,7 @@ public:
|
||||
* @param store of which to detect format
|
||||
* @return a Maildir format implementation for the specified store
|
||||
*/
|
||||
static shared_ptr <maildirFormat> detect(shared_ptr <maildirStore> store);
|
||||
static shared_ptr <maildirFormat> detect(const shared_ptr <maildirStore>& store);
|
||||
|
||||
protected:
|
||||
|
||||
@ -155,7 +155,7 @@ protected:
|
||||
static const utility::file::path::component NEW_DIR; /**< Unread messages. */
|
||||
|
||||
|
||||
maildirFormat(shared_ptr <context> ctx);
|
||||
maildirFormat(const shared_ptr <context>& ctx);
|
||||
|
||||
|
||||
/** Returns the current context.
|
||||
|
@ -48,7 +48,7 @@ namespace net {
|
||||
namespace maildir {
|
||||
|
||||
|
||||
maildirMessage::maildirMessage(shared_ptr <maildirFolder> folder, const size_t num)
|
||||
maildirMessage::maildirMessage(const shared_ptr <maildirFolder>& folder, const size_t num)
|
||||
: m_folder(folder), m_num(num), m_size(-1), m_flags(FLAG_UNDEFINED),
|
||||
m_expunged(false), m_structure(null)
|
||||
{
|
||||
@ -160,7 +160,7 @@ void maildirMessage::extract(utility::outputStream& os,
|
||||
}
|
||||
|
||||
|
||||
void maildirMessage::extractPart(shared_ptr <const messagePart> p, utility::outputStream& os,
|
||||
void maildirMessage::extractPart(const shared_ptr <const messagePart>& p, utility::outputStream& os,
|
||||
utility::progressListener* progress, const size_t start,
|
||||
const size_t length, const bool peek) const
|
||||
{
|
||||
@ -217,7 +217,7 @@ void maildirMessage::extractImpl(utility::outputStream& os, utility::progressLis
|
||||
}
|
||||
|
||||
|
||||
void maildirMessage::fetchPartHeader(shared_ptr <messagePart> p)
|
||||
void maildirMessage::fetchPartHeader(const shared_ptr <messagePart>& p)
|
||||
{
|
||||
shared_ptr <maildirFolder> folder = m_folder.lock();
|
||||
|
||||
@ -252,7 +252,7 @@ void maildirMessage::fetchPartHeader(shared_ptr <messagePart> p)
|
||||
}
|
||||
|
||||
|
||||
void maildirMessage::fetch(shared_ptr <maildirFolder> msgFolder, const fetchAttributes& options)
|
||||
void maildirMessage::fetch(const shared_ptr <maildirFolder>& msgFolder, const fetchAttributes& options)
|
||||
{
|
||||
shared_ptr <maildirFolder> folder = m_folder.lock();
|
||||
|
||||
|
@ -54,7 +54,7 @@ class VMIME_EXPORT maildirMessage : public message
|
||||
|
||||
public:
|
||||
|
||||
maildirMessage(shared_ptr <maildirFolder> folder, const size_t num);
|
||||
maildirMessage(const shared_ptr <maildirFolder>& folder, const size_t num);
|
||||
|
||||
~maildirMessage();
|
||||
|
||||
@ -76,15 +76,15 @@ public:
|
||||
void setFlags(const int flags, const int mode = FLAG_MODE_SET);
|
||||
|
||||
void extract(utility::outputStream& os, utility::progressListener* progress = NULL, const size_t start = 0, const size_t length = -1, const bool peek = false) const;
|
||||
void extractPart(shared_ptr <const messagePart> p, utility::outputStream& os, utility::progressListener* progress = NULL, const size_t start = 0, const size_t length = -1, const bool peek = false) const;
|
||||
void extractPart(const shared_ptr <const messagePart>& p, utility::outputStream& os, utility::progressListener* progress = NULL, const size_t start = 0, const size_t length = -1, const bool peek = false) const;
|
||||
|
||||
void fetchPartHeader(shared_ptr <messagePart> p);
|
||||
void fetchPartHeader(const shared_ptr <messagePart>& p);
|
||||
|
||||
shared_ptr <vmime::message> getParsedMessage();
|
||||
|
||||
private:
|
||||
|
||||
void fetch(shared_ptr <maildirFolder> folder, const fetchAttributes& options);
|
||||
void fetch(const shared_ptr <maildirFolder>& folder, const fetchAttributes& options);
|
||||
|
||||
void onFolderClosed();
|
||||
|
||||
|
@ -36,7 +36,7 @@ namespace net {
|
||||
namespace maildir {
|
||||
|
||||
|
||||
maildirMessagePart::maildirMessagePart(shared_ptr <maildirMessagePart> parent, const size_t number, const bodyPart& part)
|
||||
maildirMessagePart::maildirMessagePart(const shared_ptr <maildirMessagePart>& parent, const size_t number, const bodyPart& part)
|
||||
: m_parent(parent), m_header(null), m_number(number)
|
||||
{
|
||||
m_headerParsedOffset = part.getHeader()->getParsedOffset();
|
||||
|
@ -46,7 +46,7 @@ class maildirMessagePart : public messagePart
|
||||
{
|
||||
public:
|
||||
|
||||
maildirMessagePart(shared_ptr <maildirMessagePart> parent, const size_t number, const bodyPart& part);
|
||||
maildirMessagePart(const shared_ptr <maildirMessagePart>& parent, const size_t number, const bodyPart& part);
|
||||
~maildirMessagePart();
|
||||
|
||||
|
||||
|
@ -44,7 +44,7 @@ maildirMessageStructure::maildirMessageStructure()
|
||||
}
|
||||
|
||||
|
||||
maildirMessageStructure::maildirMessageStructure(shared_ptr <maildirMessagePart> parent, const bodyPart& part)
|
||||
maildirMessageStructure::maildirMessageStructure(const shared_ptr <maildirMessagePart>& parent, const bodyPart& part)
|
||||
{
|
||||
shared_ptr <maildirMessagePart> mpart = make_shared <maildirMessagePart>(parent, 0, part);
|
||||
mpart->initStructure(part);
|
||||
@ -53,7 +53,7 @@ maildirMessageStructure::maildirMessageStructure(shared_ptr <maildirMessagePart>
|
||||
}
|
||||
|
||||
|
||||
maildirMessageStructure::maildirMessageStructure(shared_ptr <maildirMessagePart> parent, const std::vector <shared_ptr <const vmime::bodyPart> >& list)
|
||||
maildirMessageStructure::maildirMessageStructure(const shared_ptr <maildirMessagePart>& parent, const std::vector <shared_ptr <const vmime::bodyPart> >& list)
|
||||
{
|
||||
for (size_t i = 0 ; i < list.size() ; ++i)
|
||||
{
|
||||
|
@ -47,8 +47,8 @@ class maildirMessageStructure : public messageStructure
|
||||
public:
|
||||
|
||||
maildirMessageStructure();
|
||||
maildirMessageStructure(shared_ptr <maildirMessagePart> parent, const bodyPart& part);
|
||||
maildirMessageStructure(shared_ptr <maildirMessagePart> parent, const std::vector <shared_ptr <const vmime::bodyPart> >& list);
|
||||
maildirMessageStructure(const shared_ptr <maildirMessagePart>& parent, const bodyPart& part);
|
||||
maildirMessageStructure(const shared_ptr <maildirMessagePart>& parent, const std::vector <shared_ptr <const vmime::bodyPart> >& list);
|
||||
|
||||
|
||||
shared_ptr <const messagePart> getPartAt(const size_t x) const;
|
||||
|
@ -52,7 +52,7 @@ namespace net {
|
||||
namespace maildir {
|
||||
|
||||
|
||||
maildirStore::maildirStore(shared_ptr <session> sess, shared_ptr <security::authenticator> auth)
|
||||
maildirStore::maildirStore(const shared_ptr <session>& sess, const shared_ptr <security::authenticator>& auth)
|
||||
: store(sess, getInfosInstance(), auth), m_connected(false)
|
||||
{
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ class VMIME_EXPORT maildirStore : public store
|
||||
|
||||
public:
|
||||
|
||||
maildirStore(shared_ptr <session> sess, shared_ptr <security::authenticator> auth);
|
||||
maildirStore(const shared_ptr <session>& sess, const shared_ptr <security::authenticator>& auth);
|
||||
~maildirStore();
|
||||
|
||||
const string getProtocolName() const;
|
||||
|
@ -175,7 +175,7 @@ const utility::file::path::component maildirUtils::generateId()
|
||||
}
|
||||
|
||||
|
||||
void maildirUtils::recursiveFSDelete(shared_ptr <utility::file> dir)
|
||||
void maildirUtils::recursiveFSDelete(const shared_ptr <utility::file>& dir)
|
||||
{
|
||||
shared_ptr <utility::fileIterator> files = dir->getFiles();
|
||||
|
||||
|
@ -130,7 +130,7 @@ public:
|
||||
*
|
||||
* @param dir directory to delete
|
||||
*/
|
||||
static void recursiveFSDelete(shared_ptr <utility::file> dir);
|
||||
static void recursiveFSDelete(const shared_ptr <utility::file>& dir);
|
||||
|
||||
/** Returns a list of message numbers given a message set.
|
||||
*
|
||||
|
@ -321,7 +321,7 @@ public:
|
||||
* an exception if not supported.
|
||||
*/
|
||||
virtual void extractPart
|
||||
(shared_ptr <const messagePart> p,
|
||||
(const shared_ptr <const messagePart>& p,
|
||||
utility::outputStream& os,
|
||||
utility::progressListener* progress = NULL,
|
||||
const size_t start = 0,
|
||||
@ -332,7 +332,7 @@ public:
|
||||
*
|
||||
* @param p the part for which to fetch the header
|
||||
*/
|
||||
virtual void fetchPartHeader(shared_ptr <messagePart> p) = 0;
|
||||
virtual void fetchPartHeader(const shared_ptr <messagePart>& p) = 0;
|
||||
|
||||
/** Get the RFC-822 message for this abstract message.
|
||||
* Warning: This may require getting some data (ie: structure and headers) from
|
||||
|
@ -245,7 +245,7 @@ const string POP3Command::getTraceText() const
|
||||
}
|
||||
|
||||
|
||||
void POP3Command::send(shared_ptr <POP3Connection> conn)
|
||||
void POP3Command::send(const shared_ptr <POP3Connection>& conn)
|
||||
{
|
||||
conn->getSocket()->send(m_text + "\r\n");
|
||||
|
||||
|
@ -85,7 +85,7 @@ public:
|
||||
*
|
||||
* @param conn connection onto which the command will be sent
|
||||
*/
|
||||
virtual void send(shared_ptr <POP3Connection> conn);
|
||||
virtual void send(const shared_ptr <POP3Connection>& conn);
|
||||
|
||||
/** Returns the full text of the command, including command name
|
||||
* and parameters (if any).
|
||||
|
@ -63,7 +63,7 @@ namespace pop3 {
|
||||
|
||||
|
||||
|
||||
POP3Connection::POP3Connection(shared_ptr <POP3Store> store, shared_ptr <security::authenticator> auth)
|
||||
POP3Connection::POP3Connection(const shared_ptr <POP3Store>& store, const shared_ptr <security::authenticator>& auth)
|
||||
: m_store(store), m_auth(auth), m_socket(null), m_timeoutHandler(null),
|
||||
m_authenticated(false), m_secured(false), m_capabilitiesFetched(false)
|
||||
{
|
||||
|
@ -65,7 +65,7 @@ class VMIME_EXPORT POP3Connection : public object, public enable_shared_from_thi
|
||||
{
|
||||
public:
|
||||
|
||||
POP3Connection(shared_ptr <POP3Store> store, shared_ptr <security::authenticator> auth);
|
||||
POP3Connection(const shared_ptr <POP3Store>& store, const shared_ptr <security::authenticator>& auth);
|
||||
virtual ~POP3Connection();
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user