mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +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
69289ce0cd
commit
ba01b14ce2
2 changed files with 30 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue