projects
/
enjoyable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tweak invalid filename handling. Use it for manual exports also. Allow drag exports...
[enjoyable.git]
/
NSString+FixFilename.h
diff --git
a/NSString+FixFilename.h
b/NSString+FixFilename.h
index
0850e74
..
b3e318f
100644
(file)
--- a/
NSString+FixFilename.h
+++ b/
NSString+FixFilename.h
@@
-8,12
+8,21
@@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
+@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
@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
@end