␉␊ |
}␊ |
␊ |
+(NSString*) getRenameStringFrom:(NSString*) currentStr andPartition: (PartitionInfoElement*) partInfo␊ |
{␊ |
␉if (partInfo != nil && currentStr!=nil)␊ |
␉{␊ |
␉␉NSMutableString* ms = [[NSMutableString alloc ] initWithCapacity: 512];␊ |
␉␉␊ |
␉␉NSArray* sPairs =␊ |
␉␉ [currentStr componentsSeparatedByCharactersInSet: ␊ |
␉␉␉[NSCharacterSet characterSetWithCharactersInString: @";"] ];␊ |
␉␉␊ |
␉␉if ([sPairs count] > 0 )␊ |
␉␉{␊ |
␉␉␉␊ |
␉␉␉for (NSString* s in sPairs)␊ |
␉␉␉{␊ |
␉␉␉␉if ( s==nil || [s length] == 0) continue;␊ |
␊ |
␉␉␉␉if ( [ s rangeOfString:[partInfo hdString]].location == NSNotFound )␊ |
␉␉␉␉{␊ |
␉␉␉␉␉if ([ms length] > 0) [ ms appendString:@";" ];␊ |
␉␉␉␉␉[ms appendString: [NSString stringWithFormat:@"%@",s ]];␊ |
␉␉␉␉}␊ |
␉␉␉}␊ |
␉␉␉␊ |
␉␉}␊ |
␉␉// now filter the case where name eauls alias -> no rename anymore␉␉␊ |
␉␉if ( ![[partInfo vName] isEqual: [partInfo vAliasName]])␊ |
␉␉{␊ |
␉␉␉if ([ms length] > 0) [ ms appendString:@";" ];␊ |
␉␉␉[ms appendString: [NSString stringWithFormat:@"%@ \"%@\"" ,␊ |
␉␉␉␉␉␉␉ [partInfo hdString], [partInfo vAliasName] ]];␊ |
␉␉}␊ |
␉␉return ms;␊ |
␉}␊ |
␊ |
␉return nil;␊ |
}␊ |
␊ |
@end␊ |