diff options
author | Vincent Richard <[email protected]> | 2005-11-04 23:21:22 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2005-11-04 23:21:22 +0000 |
commit | acfa9ffc64f56de42049bf5049810c15477729ed (patch) | |
tree | 3bb84a7319fb209c00f656927c83965f03bd5329 /src/mailboxField.cpp | |
parent | Fixed typo for 'ac_cv_sizeof_long'. (diff) | |
download | vmime-acfa9ffc64f56de42049bf5049810c15477729ed.tar.gz vmime-acfa9ffc64f56de42049bf5049810c15477729ed.zip |
Refactored header field values and parameters.
Diffstat (limited to 'src/mailboxField.cpp')
-rw-r--r-- | src/mailboxField.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
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 <mailbox>() + : 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 <mailbox> mbox = vmime::create <mailbox>(); // 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 <mailboxGroup> group = parsedAddress.staticCast <mailboxGroup>(); if (!group->isEmpty()) - getValue() = *(group->getMailboxAt(0)); + mbox = group->getMailboxAt(0); } else { // Parse only if it is a mailbox - getValue() = *parsedAddress.staticCast <mailbox>(); + mbox = parsedAddress.staticCast <mailbox>(); } } - 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 + |