mimeReaderMoveToNextEntitySibling

SYNOPSIS

int mimeReaderMoveToNextEntitySibling(mimeReader reader)

Parameters:

  • reader - A mimeReader object

Returns:

  • int value: 1 on success, 0 on EOF, -1 on error


DESCRIPTION
The mimeReaderMoveToNextEntitySibling function is like mimeReaderMoveToNextEntity (here), but moves to the next "sibling" in the message tree, i.e. it skips over the current entity's descendants (if any). It returns 1 if successful (new entity reached), 0 if end of message (no more entities), or -1 on error. The entities will be traversed in message order, i.e. pre-order.


EXAMPLE
Changing the <main> function of the example script above (here) to the following:

<local reader>
  <$reader = (mimeReaderOpenFile($file))>
  <$ret = (mimeReaderMoveToNextEntity($reader))>
  <printEntity entity=$reader>     <!-- multipart/mixed preamble -->
  <$ret = (mimeReaderMoveToNextEntity($reader))>
  <printEntity entity=$reader>     <!-- multipart/related preamble -->
  <while (mimeReaderMoveToNextEntitySibling($reader) = '1')>
    <printEntity entity=$reader>
  </while>

would yield the following output when run on the example MIME message (here):

0 multipart/mixed [part.bin] Preamble of multipart/mixed me...
  1.0 multipart/related [part-2.bin] Preamble of multipart/related ...
  2 image/gif [attachment.gif] GIF89a....


SEE ALSO
mimeReaderMoveToNextEntity


Copyright © Thunderstone Software     Last updated: Apr 15 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.