source: npl/overig/libvmime/vmime-backport-mailboxList-parser-29954e5.diff @ d7191d1

gcc484perl-5.22
Last change on this file since d7191d1 was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 1.5 KB
  • src/mailboxList.cpp

    diff -urb libvmime-0.9.2.orig/src/mailboxList.cpp libvmime-0.9.2/src/mailboxList.cpp
    old new  
    2222//
    2323
    2424#include "vmime/mailboxList.hpp"
     25#include "vmime/mailboxGroup.hpp"
    2526#include "vmime/exception.hpp"
    2627
    2728
     
    199200void mailboxList::parse(const string& buffer, const string::size_type position,
    200201        const string::size_type end, string::size_type* newPosition)
    201202{
    202         m_list.parse(buffer, position, end, newPosition);
     203        string::size_type pos = position;
     204
     205        while (pos < end)
     206        {
     207                ref <address> parsedAddress = address::parseNext(buffer, pos, end, &pos);
     208
     209                if (parsedAddress != NULL)
     210                {
     211                        if (parsedAddress->isGroup())
     212                        {
     213                                ref <mailboxGroup> group = parsedAddress.staticCast <mailboxGroup>();
     214
     215                                for (size_t i = 0 ; i < group->getMailboxCount() ; ++i)
     216                                {
     217                                        m_list.appendAddress(group->getMailboxAt(i));
     218                                }
     219                        }
     220                        else
     221                        {
     222                                m_list.appendAddress(parsedAddress);
     223                        }
     224                }
     225        }
     226
     227        setParsedBounds(position, end);
     228
     229        if (newPosition)
     230                *newPosition = end;
    203231}
    204232
    205233
  • vmime/address.hpp

    diff -urb libvmime-0.9.2.orig/vmime/address.hpp libvmime-0.9.2/vmime/address.hpp
    old new  
    6565
    6666        virtual ref <component> clone() const = 0;
    6767
    68 protected:
    6968
    7069        /** Parse an address from an input buffer.
    7170          *
Note: See TracBrowser for help on using the repository browser.