ObjFW  Check-in [3eb411511e]

Overview
Comment:Add +[OFURL fileURLWithPath:]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 3eb411511e3ddd872e411e5838dbd063c8dedbc4d0f50582202c4946359cee8a
User & Date: js on 2016-02-21 12:04:17
Other Links: manifest | tags
Context
2016-02-21
15:37
Make use of C99-style for loops check-in: e0b9167693 user: js tags: trunk
12:04
Add +[OFURL fileURLWithPath:] check-in: 3eb411511e user: js tags: trunk
11:59
OFArray: Fix bug introduced by refactorization check-in: 8a14ad35aa user: js tags: trunk
Changes

Modified src/OFURL.h from [1f6d5f7a9d] to [b9cdd57013].

100
101
102
103
104
105
106








107
108
109
110
111
112
113
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121







+
+
+
+
+
+
+
+







 * @param string A string describing a URL
 * @param URL An URL to which the string is relative
 * @return A new, autoreleased OFURL
 */
+ (instancetype)URLWithString: (OFString*)string
		relativeToURL: (OFURL*)URL;

/*!
 * @brief Creates a new URL with the specified local file path.
 *
 * @param path The local file path
 * @return A new, autoreleased OFURL
 */
+ (instancetype)fileURLWithPath: (OFString*)path;

/*!
 * @brief Initializes an already allocated OFURL with the specified string.
 *
 * @param string A string describing a URL
 * @return An initialized OFURL
 */
- initWithString: (OFString*)string;

Modified src/OFURL.m from [a6e52ebdfd] to [bdf49c5547].

46
47
48
49
50
51
52













53
54
55
56
57
58
59
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72







+
+
+
+
+
+
+
+
+
+
+
+
+








+ (instancetype)URLWithString: (OFString*)string
		relativeToURL: (OFURL*)URL
{
	return [[[self alloc] initWithString: string
			       relativeToURL: URL] autorelease];
}

+ (instancetype)fileURLWithPath: (OFString*)path
{
	OFURL *URL = [OFURL URL];
	void *pool = objc_autoreleasePoolPush();

	[URL setScheme: @"file"];
	[URL setPath: [[path pathComponents] componentsJoinedByString: @"/"]];

	objc_autoreleasePoolPop(pool);

	return URL;
}

- initWithString: (OFString*)string
{
	char *UTF8String, *UTF8String2 = NULL;

	self = [super init];