/usr/include/mimelib/mboxlist.h is in libmimelib1-dev 5:1.1.4-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | //=============================================================================
// File: mboxlist.h
// Contents: Declarations for DwMailboxList
// Maintainer: Doug Sauder <dwsauder@fwb.gulf.net>
// WWW: http://www.fwb.gulf.net/~dwsauder/mimepp.html
//
// Copyright (c) 1996, 1997 Douglas W. Sauder
// All rights reserved.
//
// IN NO EVENT SHALL DOUGLAS W. SAUDER BE LIABLE TO ANY PARTY FOR DIRECT,
// INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
// THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF DOUGLAS W. SAUDER
// HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// DOUGLAS W. SAUDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT
// NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
// PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
// BASIS, AND DOUGLAS W. SAUDER HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
// SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
//
//=============================================================================
#ifndef DW_MBOXLIST_H
#define DW_MBOXLIST_H
#ifndef DW_CONFIG_H
#include <mimelib/config.h>
#endif
#ifndef DW_STRING_H
#include <mimelib/string.h>
#endif
#ifndef DW_ADDRESS_H
#include <mimelib/address.h>
#endif
//=============================================================================
//+ Name DwMailboxList -- Class representing a list of RFC-822 mailboxes
//+ Description
//. {\tt DwMailboxList} represents a list of {\it mailboxes} as described
//. in RFC-822. In MIME++, {\tt DwMailboxList} is a container for objects
//. of type {\tt DwMailbox}, and it contains various member functions to
//. manage its contained objects. {\tt DwAddressList} is also a
//. {\tt DwFieldBody}. This reflects the fact that certain RFC-822 header
//. fields, such as the "From" header field, have a list of mailboxes as
//. their field bodies.
//=============================================================================
// Last modified 1997-08-30
//+ Noentry ~DwMailboxList _PrintDebugInfo
class DW_EXPORT DwMailboxList : public DwFieldBody {
public:
DwMailboxList();
DwMailboxList(const DwMailboxList& aList);
DwMailboxList(const DwString& aStr, DwMessageComponent* aParent=0);
//. The first constructor is the default constructor, which sets the
//. {\tt DwMailboxList} object's string representation to the empty string
//. and sets its parent to {\tt NULL}.
//.
//. The second constructor is the copy constructor, which copies the
//. string representation and all {\tt DwMailbox} objects from {\tt aList}.
//. The parent of the new {\tt DwMailboxList} object is set to {\tt NULL}.
//.
//. The third constructor copies {\tt aStr} to the {\tt DwMailboxList}
//. object's string representation and sets {\tt aParent} as its parent.
//. The virtual member function {\tt Parse()} should be called immediately
//. after this constructor in order to parse the string representation.
//. Unless it is {\tt NULL}, {\tt aParent} should point to an object of
//. a class derived from {\tt DwField}.
virtual ~DwMailboxList();
const DwMailboxList& operator = (const DwMailboxList& aList);
//. This is the assignment operator, which performs a deep copy of
//. {\tt aList}. The parent node of the {\tt DwMailboxList} object
//. is not changed.
virtual void Parse();
//. This virtual function, inherited from {\tt DwMessageComponent},
//. executes the parse method for {\tt DwMailboxList} objects. The parse
//. method creates or updates the broken-down representation from the
//. string representation. For {\tt DwMailboxList} objects, the parse
//. method parses the string representation to create a list of
//. {\tt DwMailbox} objects. This member function also calls the
//. {\tt Parse()} member function of each {\tt DwMailbox} object in
//. its list.
//.
//. You should call this member function after you set or modify the
//. string representation, and before you access any of the contained
//. {\tt DwMailbox} objects.
//.
//. This function clears the is-modified flag.
virtual void Assemble();
//. This virtual function, inherited from {\tt DwMessageComponent},
//. executes the assemble method for {\tt DwMailboxList} objects. The
//. assemble method creates or updates the string representation from
//. the broken-down representation. For {\tt DwMailboxList} objects,
//. the assemble method builds the string representation from its list
//. of {\tt DwMailbox} objects. Before it builds the string representation
//. for the {\tt DwMailboxList} object, this function first calls the
//. {\tt Assemble()} member function of each {\tt DwMailbox} object
//. in its list.
//.
//. You should call this member function after you set or modify any
//. of the contained {\tt DwMailbox} objects, and before you retrieve
//. the string representation.
//.
//. This function clears the is-modified flag.
virtual DwMessageComponent* Clone() const;
//. This virtual function, inherited from {\tt DwMessageComponent},
//. creates a new {\tt DwMailboxList} on the free store that has the same
//. value as this {\tt DwMailboxList} object. The basic idea is that of
//. a virtual copy constructor.
DwMailbox* FirstMailbox() const;
//. Gets the first {\tt DwMailbox} object in the list.
//. Use the member function {\tt DwMailbox::Next()} to iterate.
//. Returns {\tt NULL} if the list is empty.
void Add(DwMailbox* aMailbox);
//. Adds {\tt aMailbox} to the end of the list of {\tt DwMailbox} objects
//. maintained by this {\tt DwMailboxList} object.
void Remove(DwMailbox* aMailbox);
//. Removes {\tt aMailbox} from the list of {\tt DwMailbox} objects
//. maintained by this {\tt DwMailboxList} object. The {\tt DwMailbox}
//. object is not deleted by this member function.
void DeleteAll();
//. Removes and deletes all {\tt DwMailbox} objects from the list
//. maintained by this {\tt DwMailboxList} object.
static DwMailboxList* NewMailboxList(const DwString& aStr,
DwMessageComponent* aParent);
//. Creates a new {\tt DwMailboxList} object on the free store.
//. If the static data member {\tt sNewMailboxList} is {\tt NULL},
//. this member function will create a new {\tt DwMailboxList}
//. and return it. Otherwise, {\tt NewMailboxList()} will call
//. the user-supplied function pointed to by {\tt sNewMailboxList},
//. which is assumed to return an object from a class derived from
//. {\tt DwMailboxList}, and return that object.
//+ Var sNewMailboxList
static DwMailboxList* (*sNewMailboxList)(const DwString&,
DwMessageComponent*);
//. If {\tt sNewMailboxList} is not {\tt NULL}, it is assumed to point
//. to a user-supplied function that returns an object from a class
//. derived from {\tt DwMailboxList}.
protected:
DwMailbox* mFirstMailbox;
//. Points to first {\tt DwMailbox} object in list.
void _AddMailbox(DwMailbox* aMailbox);
//. Adds a mailbox, but does not set the is-modified flag.
void _DeleteAll();
//. Removes and deletes all {\tt DwMailbox} objects from the list
//. maintained by this {\tt DwMailboxList} object. Doesn't set the
//. is-modified flag.
private:
static const char* const sClassName;
void CopyList(const DwMailbox* aFirst);
public:
virtual void PrintDebugInfo(std::ostream& aStrm, int aDepth=0) const;
//. This virtual function, inherited from {\tt DwMessageComponent},
//. prints debugging information about this object to {\tt aStrm}.
//. It will also call {\tt PrintDebugInfo()} for any of its child
//. components down to a level of {\tt aDepth}.
//.
//. This member function is available only in the debug version of
//. the library.
virtual void CheckInvariants() const;
//. Aborts if one of the invariants of the object fails. Use this
//. member function to track down bugs.
//.
//. This member function is available only in the debug version of
//. the library.
protected:
void _PrintDebugInfo(std::ostream& aStrm) const;
};
class DW_EXPORT DwMailboxListParser {
public:
enum {
eMbError,
eMbGroup,
eMbMailbox,
eMbNull,
eMbEnd
};
DwMailboxListParser(const DwString& aStr);
virtual ~DwMailboxListParser();
const DwString& MbString() { return mMbString.Tokens(); }
int MbType() { return mMbType; }
int IsNull() { return (mMbType == eMbNull) ? 1 : 0; }
int IsEnd() { return (mMbType == eMbEnd) ? 1 : 0; }
int Restart();
int operator ++ (); // prefix increment operator
protected:
void ParseNextMailbox();
DwRfc822Tokenizer mTokenizer;
DwTokenString mMbString;
int mMbType;
};
#endif
|