92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
[mutex unlock];
}
#endif
return true;
}
+ (OF_KINDOF(OFURLHandler *))handlerForURL: (OFURL *)URL
{
OF_KINDOF(OFURLHandler *) handler;
#ifdef OF_HAVE_THREADS
[mutex lock];
@try {
#endif
handler = [handlers objectForKey: URL.scheme];
#ifdef OF_HAVE_THREADS
} @finally {
[mutex unlock];
}
#endif
if (handler == nil)
@throw [OFUnsupportedProtocolException exceptionWithURL: URL];
return handler;
}
- (instancetype)init
{
OF_INVALID_INIT_METHOD
}
- (instancetype)initWithScheme: (OFString *)scheme
|
|
>
>
>
>
>
|
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
[mutex unlock];
}
#endif
return true;
}
+ (OFURLHandler *)handlerForURL: (OFURL *)URL
{
OF_KINDOF(OFURLHandler *) handler;
#ifdef OF_HAVE_THREADS
[mutex lock];
@try {
#endif
handler = [handlers objectForKey: URL.scheme];
#ifdef OF_HAVE_THREADS
} @finally {
[mutex unlock];
}
#endif
if (handler == nil)
@throw [OFUnsupportedProtocolException exceptionWithURL: URL];
return handler;
}
+ (OFStream *)openItemAtURL: (OFURL *)URL mode: (OFString *)mode
{
return [[self handlerForURL: URL] openItemAtURL: URL mode: mode];
}
- (instancetype)init
{
OF_INVALID_INIT_METHOD
}
- (instancetype)initWithScheme: (OFString *)scheme
|