X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=NSString%2BFixFilename.h;h=b3e318f0b3bbf2fec066b8fb0a24c6be57da7d2c;hp=0850e744518e5f4e78e0ead4ba9ef3a189a83934;hb=56d825ba259066d847a9fc3f9c8c0c0a362a1507;hpb=b8c30e0c06effb8f4a937378e5c4cf8a22f40c59 diff --git a/NSString+FixFilename.h b/NSString+FixFilename.h index 0850e74..b3e318f 100644 --- a/NSString+FixFilename.h +++ b/NSString+FixFilename.h @@ -8,12 +8,21 @@ #import +@interface NSCharacterSet (FixFilename) + ++ (NSCharacterSet *)invalidPathComponentCharacterSet; + // A character set containing the characters that are invalid to + // use in path components on common filesystems. + +@end + @interface NSString (FixFilename) - (NSString *)stringByFixingPathComponent; // Does various operations to make this string suitable for use as - // a single path component of a normal filename. Removes / and : - // characters and prepends a _ to avoid leading .s or an empty - // name. + // a single path component of a normal filename. Removes + // characters that are invalid. Strips whitespace from the + // beginning and end. If the first character is a . or a -, a _ is + // added to the front. @end