Tweak invalid filename handling. Use it for manual exports also. Allow drag exports...
[enjoyable.git] / NSString+FixFilename.h
1 //
2 // NSString+FixFilename.h
3 // Enjoyable
4 //
5 // Created by Joe Wreschnig on 3/7/13.
6 //
7 //
8
9 #import <Foundation/Foundation.h>
10
11 @interface NSCharacterSet (FixFilename)
12
13 + (NSCharacterSet *)invalidPathComponentCharacterSet;
14 // A character set containing the characters that are invalid to
15 // use in path components on common filesystems.
16
17 @end
18
19 @interface NSString (FixFilename)
20
21 - (NSString *)stringByFixingPathComponent;
22 // Does various operations to make this string suitable for use as
23 // a single path component of a normal filename. Removes
24 // characters that are invalid. Strips whitespace from the
25 // beginning and end. If the first character is a . or a -, a _ is
26 // added to the front.
27
28 @end