Debian Codegraph @

Framework/Pantomime/CWMIMEMultipart.m

raw
1 /*
2 ** CWMIMEMultipart.m
3 **
4 ** Copyright (c) 2001-2004 Ludovic Marcotte
5 ** Copyright (C) 2017 Riccardo Mottola
6 **
7 ** Author: Ludovic Marcotte <[email protected]>
8 ** Riccardo Mottola <[email protected]>
9 **
10 ** This library is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU Lesser General Public
12 ** License as published by the Free Software Foundation; either
13 ** version 2.1 of the License, or (at your option) any later version.
14 **
15 ** This library is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** Lesser General Public License for more details.
19 **
20 ** You should have received a copy of the GNU General Public License
21 ** along with this program. If not, see <http://www.gnu.org/licenses/>.
22 */
23
24 #import <Pantomime/CWMIMEMultipart.h>
25
26 #import <Pantomime/CWConstants.h>
27
28 //
29 //
30 //
31 @implementation CWMIMEMultipart
32
33 - (id) init
34 {
35 self = [super init];
36 if (self)
37 {
38 _parts = [[NSMutableArray alloc] init];
39 }
40 return self;
41 }
42
43
44 //
45 //
46 //
47 - (void) dealloc
48 {
49 RELEASE(_parts);
50 [super dealloc];
51 }
52
53
54 //
55 //
56 //
57 - (void) addPart: (CWPart *) thePart
58 {
59 if (thePart)
60 {
61 [_parts addObject: thePart];
62 }
63 }
64
65
66 //
67 //
68 //
69 - (void) removePart: (CWPart *) thePart
70 {
71 if (thePart)
72 {
73 [_parts removeObject: thePart];
74 }
75 }
76
77
78 //
79 //
80 //
81 - (NSUInteger) count
82 {
83 return [_parts count];
84 }
85
86
87 //
88 //
89 //
90 - (CWPart *) partAtIndex: (NSUInteger) theIndex
91 {
92 return [_parts objectAtIndex: theIndex];
93 }
94
95 @end