gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: additional methods in NSMutableString


From: Richard Frith-Macdonald
Subject: Re: additional methods in NSMutableString
Date: Tue, 4 Jan 2005 09:58:03 +0000


On 4 Jan 2005, at 09:40, Manuel Guesdon wrote:

Hi,

Would it be possible to add the following methods for NSMutableString in GNUstep additions ?
- (void) abbreviateWithTildeInPath;
- (void) appendingPathComponent: (NSString*)aString;
- (void) appendingPathExtension: (NSString*)aString;
- (void) deletingLastPathComponent;
- (void) deletingPathExtension;
- (void) expandingTildeInPath;
- (void) resolvingSymlinksInPath;
- (void) standardizingPath;

Without them, we add to use NSString stringByXXX and create many (uneeded in some cases) temporary string. When searchng for a particular file in a tree, we build a lot of this temporary
strings...

I don't see why not, but I wouldn't use those names (apart from the first one).

Method names are generally the correct english to describe what they do,
so we should use 'append', 'delete', 'expand', 'resolve', 'standardize' without the 'ing' suffixes, as these methods will modify the receiver rather than
returning a new string.

eg.
The method 'stringByDeletingPathExtension' returns the string formed by
deleting the path extension from the receiver, while the counterpart for a mutable string would be 'deletePathExtension', which tells the receiver to
delete its own path extension.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]