This repository has been archived by the owner on Dec 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
RCIOItem.h
59 lines (46 loc) · 1.98 KB
/
RCIOItem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// RCIOItem.h
// ReactiveCocoaIO
//
// Created by Uri Baghin on 9/26/12.
// Copyright (c) 2013 Uri Baghin. All rights reserved.
//
#import <Foundation/Foundation.h>
@class RACSignal, RACChannelTerminal, RCIODirectory;
// Specifies how the file system item should be accessed.
//
// RCIOItemModeReadWrite - Access the item for both reading and writing.
// If the item doesn't exist on the file system,
// it will be created.
// RCIOItemModeExclusiveAccess - Ensure the returned RCIOItem is the only handle
// to the file system item. Doesn't currently
// provide any guarantee to that other than
// ensuring the file system item didn't exist
// before the call.
typedef enum : NSUInteger {
RCIOItemModeReadWrite = 0,
RCIOItemModeExclusiveAccess = 1 << 8,
} RCIOItemMode;
@interface RCIOItem : NSObject
// Returns a signal that sends the item at `url`, then completes.
//
// url - The url of the file system item to access.
// mode - Specifies how the file system item should be accessed.
//
// Note that the RCIOItem class itself does not support creating items that
// do not already exist on the file system. Use the subclasses instead.
+ (RACSignal *)itemWithURL:(NSURL *)url mode:(RCIOItemMode)mode;
// Equivalent to `-itemWithURL:url mode:RCIOItemModeReadWrite`.
+ (RACSignal *)itemWithURL:(NSURL *)url;
// The url of the receiver.
- (NSURL *)url;
// Returns a signal that sends the URL of the receiver.
@property (nonatomic, strong, readonly) RACSignal *urlSignal;
// Returns a signal that sends the parent directory of the receiver.
@property (nonatomic, strong, readonly) RACSignal *parentSignal;
@end
@interface RCIOItem (ExtendedAttributes)
// Returns a channel terminal for the receiver's extended attribute identified
// by `key`.
- (RACChannelTerminal *)extendedAttributeChannelForKey:(NSString *)key;
@end