From acfa9ffc64f56de42049bf5049810c15477729ed Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Fri, 4 Nov 2005 23:21:22 +0000 Subject: Refactored header field values and parameters. --- src/mailboxField.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/mailboxField.cpp') diff --git a/src/mailboxField.cpp b/src/mailboxField.cpp index bab461be..188fa17b 100644 --- a/src/mailboxField.cpp +++ b/src/mailboxField.cpp @@ -25,6 +25,9 @@ #include "vmime/mailboxGroup.hpp" +#ifndef VMIME_BUILDING_DOC + + namespace vmime { @@ -35,7 +38,7 @@ mailboxField::mailboxField() mailboxField::mailboxField(const mailboxField&) - : headerField(), genericField () + : headerField() { } @@ -43,7 +46,7 @@ mailboxField::mailboxField(const mailboxField&) void mailboxField::parse(const string& buffer, const string::size_type position, const string::size_type end, string::size_type* newPosition) { - getValue().clear(); + ref mbox = vmime::create (); // Here, we cannot simply call "m_mailbox.parse()" because it // may have more than one address specified (even if this field @@ -59,16 +62,18 @@ void mailboxField::parse(const string& buffer, const string::size_type position, ref group = parsedAddress.staticCast (); if (!group->isEmpty()) - getValue() = *(group->getMailboxAt(0)); + mbox = group->getMailboxAt(0); } else { // Parse only if it is a mailbox - getValue() = *parsedAddress.staticCast (); + mbox = parsedAddress.staticCast (); } } - getValue().setParsedBounds(position, end); + mbox->setParsedBounds(position, end); + + setValue(mbox); setParsedBounds(position, end); @@ -78,3 +83,7 @@ void mailboxField::parse(const string& buffer, const string::size_type position, } // vmime + + +#endif // VMIME_BUILDING_DOC + -- cgit v1.2.3