Merge pull request #201 from 0xd34df00d/master
Added net::message::getName() + the IMAP implementation
This commit is contained in:
commit
5cd1f2990a
@ -68,6 +68,11 @@ IMAPMessagePart::IMAPMessagePart(const shared_ptr <IMAPMessagePart>& parent, con
|
||||
part->body_type_basic()->media_basic()->media_subtype()->value());
|
||||
|
||||
m_size = part->body_type_basic()->body_fields()->body_fld_octets()->value();
|
||||
|
||||
if (const auto pparam = part->body_type_basic()->body_fields()->body_fld_param())
|
||||
for (const auto& param : pparam->items())
|
||||
if (param->string1()->value() == "NAME")
|
||||
m_name = param->string2()->value();
|
||||
}
|
||||
|
||||
m_structure = null;
|
||||
@ -115,6 +120,11 @@ size_t IMAPMessagePart::getNumber() const
|
||||
return m_number;
|
||||
}
|
||||
|
||||
string IMAPMessagePart::getName() const
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
|
||||
shared_ptr <const header> IMAPMessagePart::getHeader() const
|
||||
{
|
||||
|
@ -59,6 +59,7 @@ public:
|
||||
const mediaType& getType() const;
|
||||
size_t getSize() const;
|
||||
size_t getNumber() const;
|
||||
string getName() const;
|
||||
|
||||
shared_ptr <const header> getHeader() const;
|
||||
|
||||
@ -77,6 +78,7 @@ private:
|
||||
|
||||
size_t m_number;
|
||||
size_t m_size;
|
||||
string m_name;
|
||||
mediaType m_mediaType;
|
||||
};
|
||||
|
||||
|
@ -36,6 +36,11 @@ namespace vmime {
|
||||
namespace net {
|
||||
|
||||
|
||||
string messagePart::getName() const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
shared_ptr <const messagePart> messagePart::getPartAt(const size_t pos) const
|
||||
{
|
||||
return getStructure()->getPartAt(pos);
|
||||
|
@ -99,6 +99,16 @@ public:
|
||||
*/
|
||||
virtual size_t getNumber() const = 0;
|
||||
|
||||
/** Return the name of this part. In particular, this corresponds to
|
||||
* the attachment file name for attachment parts.
|
||||
*
|
||||
* The part name may be empty if the part does not advertise it or
|
||||
* if the underlying protocol does not support it.
|
||||
*
|
||||
* @return part name
|
||||
*/
|
||||
virtual string getName() const;
|
||||
|
||||
/** Return the sub-part at the specified position (zero is the
|
||||
* first part).
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user