home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-07-28 | 2.0 KB | 81 lines | [TEXT/MPS ] |
- /*
- File: CQueueEnumerator.h
-
- Contains: xxx put contents here xxx
-
- Written by: Tim Harnett
-
- Copyright: © 1994 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <1> 9/22/94 TMH made this from stuff in TMSAMSlot::GetIncomingLetter
- 9/22/94 TMH xxx put comment here xxx
-
- To Do:
- */
-
- //••• So far only the Out queue enumerator is implemented.
-
- #ifndef __CQueueEnumerator__
- #define __CQueueEnumerator__
-
-
- #ifndef __OCEMAIL__
- #include <OCEMail.h>
- #endif
-
-
- //----------------------------------
- // MSAMEnumerate helper-structures
- //----------------------------------
-
- //
- // EnumInQReply:
- //
- // this structure is returned by the MSAMEnumerate call (in the data buffer). It's the
- // number of messages enumerated (2 bytes) followed by each message.
-
- typedef struct EnumInQReply {
- MailReply reply; // # of messages returned
- MSAMEnumerateInQReply message; // message storage
- } EnumInQReply, *EnumInQReplyPtr;
-
-
- // EnumOutQReply:
- //
- // this structure is returned by the MSAMEnumerate call (in the data buffer). It's the
- // number of messages enumerated (2 bytes) followed by each message. We ask for only
- // one letter each time we call MSAMEnumerate.
-
- typedef struct EnumOutQReply {
- MailReply reply; // just a short holding # of messages returned
- MSAMEnumerateOutQReply outQEnumReply; // message storage
- } EnumOutQReply, *EnumOutQReplyPtr;
-
-
-
-
- //---------------------------------
- // C O u t Q E n u m e r a t o r
- //---------------------------------
-
- // Notes :
- // 1. We enumerate only 1 letter at a time.
-
- class COutQEnumerator {
- public:
- COutQEnumerator(MSAMQueueRef qRef);
- MSAMEnumerateOutQReply* FirstLetter();
- Boolean More() { return (fPB.ioResult == 0) && (fPB.buffer.dataSize>sizeof(short)) && (fPB.startSeqNum!=0) ; };
- MSAMEnumerateOutQReply* NextLetter();
- void Enumerate();
- OSErr IOResult() { return fPB.ioResult; };
- private:
- MSAMEnumeratePB fPB;
- EnumOutQReply fEnumBlock;
-
- };
-
-
- #endif __CQueueEnumerator__