mirror of
https://github.com/textmate/textmate.git
synced 2026-01-14 09:18:07 -05:00
Add convenience constructor to OakDocument
This commit is contained in:
@@ -25,6 +25,7 @@ typedef NS_ENUM(NSInteger, OakDocumentIOResult) {
|
||||
PUBLIC @interface OakDocument : NSObject
|
||||
+ (instancetype)documentWithPath:(NSString*)aPath;
|
||||
+ (instancetype)documentWithData:(NSData*)someData fileType:(NSString*)aFileType customName:(NSString*)aName;
|
||||
+ (instancetype)documentWithString:(NSString*)content fileType:(NSString*)aFileType customName:(NSString*)aName;
|
||||
+ (instancetype)documentWithIdentifier:(NSUUID*)anIdentifier;
|
||||
|
||||
@property (nonatomic) NSUUID* identifier;
|
||||
|
||||
@@ -390,6 +390,11 @@ private:
|
||||
return [[OakDocument alloc] initWithData:someData fileType:aFileType customName:aName];
|
||||
}
|
||||
|
||||
+ (instancetype)documentWithString:(NSString*)content fileType:(NSString*)aFileType customName:(NSString*)aName
|
||||
{
|
||||
return [[OakDocument alloc] initWithData:[content dataUsingEncoding:NSUTF8StringEncoding] fileType:aFileType customName:aName];
|
||||
}
|
||||
|
||||
+ (instancetype)documentWithIdentifier:(NSUUID*)anIdentifier
|
||||
{
|
||||
return [[OakDocument alloc] initWithIdentifier:anIdentifier];
|
||||
|
||||
Reference in New Issue
Block a user