diff options
Diffstat (limited to 'src/mailboxField.cpp')
-rw-r--r-- | src/mailboxField.cpp | 41 |
1 files changed, 10 insertions, 31 deletions
diff --git a/src/mailboxField.cpp b/src/mailboxField.cpp index e4e0164c..3cd7d910 100644 --- a/src/mailboxField.cpp +++ b/src/mailboxField.cpp @@ -30,10 +30,16 @@ mailboxField::mailboxField() } +mailboxField::mailboxField(const mailboxField&) + : headerField(), genericField <mailbox>() +{ +} + + void mailboxField::parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition) { - m_mailbox.clear(); + getValue().clear(); // Here, we cannot simply call "m_mailbox.parse()" because it // may have more than one address specified (even if this field @@ -48,13 +54,13 @@ void mailboxField::parse(const string& buffer, const string::size_type position, // mailbox of the group mailboxGroup* group = static_cast <mailboxGroup*>(parsedAddress); - if (!group->empty()) - m_mailbox = *(group->begin()); + if (!group->isEmpty()) + getValue() = *(group->getMailboxAt(0)); } else { // Parse only if it is a mailbox - m_mailbox = *static_cast <mailbox*>(parsedAddress); + getValue() = *static_cast <mailbox*>(parsedAddress); } } @@ -65,31 +71,4 @@ void mailboxField::parse(const string& buffer, const string::size_type position, } -void mailboxField::generate(utility::outputStream& os, const string::size_type maxLineLength, - const string::size_type curLinePos, string::size_type* newLinePos) const -{ - string::size_type pos = curLinePos; - - headerField::generate(os, maxLineLength, pos, &pos); - - m_mailbox.generate(os, maxLineLength, pos, newLinePos); -} - - -mailboxField& mailboxField::operator=(const class mailbox& mailbox) -{ - m_mailbox = mailbox; - return (*this); -} - - -void mailboxField::copyFrom(const headerField& field) -{ - const mailboxField& source = dynamic_cast<const mailboxField&>(field); - m_mailbox = source.m_mailbox; - - headerField::copyFrom(field); -} - - } // vmime |