mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Add method for consistency
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@18320 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
748132fd61
commit
c513572553
2 changed files with 30 additions and 0 deletions
|
@ -120,6 +120,7 @@
|
|||
- (NSArray*) contentsByName: (NSString*)key;
|
||||
- (NSData*) convertToData;
|
||||
- (NSString*) convertToText;
|
||||
- (void) deleteContent: (GSMimeDocument*)aPart;
|
||||
- (void) deleteHeader: (GSMimeHeader*)aHeader;
|
||||
- (void) deleteHeaderNamed: (NSString*)name;
|
||||
- (GSMimeHeader*) headerNamed: (NSString*)name;
|
||||
|
|
|
@ -3705,6 +3705,35 @@ static NSCharacterSet *tokenSet = nil;
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all ocurrances of parts identical to aPart from the receiver.<br />
|
||||
* Recursively deletes from enclosed documents as necessary.
|
||||
*/
|
||||
- (void) deleteContent: (GSMimeDocument*)aPart
|
||||
{
|
||||
if (aPart != nil)
|
||||
{
|
||||
if ([content isKindOfClass: [NSMutableArray class]] == YES)
|
||||
{
|
||||
unsigned count = [content count];
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
GSMimeDocument *part = [content objectAtIndex: count];
|
||||
|
||||
if (part == aPart)
|
||||
{
|
||||
[content removeObjectAtIndex: count];
|
||||
}
|
||||
else
|
||||
{
|
||||
[part deleteContent: part]; // Recursive.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method removes all occurrances of header objects identical to
|
||||
* the one supplied as an argument.
|
||||
|
|
Loading…
Reference in a new issue