ObjFW  Diff

Differences From Artifact [3b195e39ec]:

  • File src/OFString.m — part of check-in [545b6f740e] at 2013-01-13 13:07:52 on branch trunk — Add of_char{16,32}_t.

    For ObjC++, these are defined to char{16,32}_t if C++11 is used. This
    means passing e.g. a C++11 UTF-16 string to -[initWithUTF16String:]
    works without a warning.

    For C11, this is not necessary, as char{16,32}_t are just typedef'd to
    uint_least{16,32}_t in <uchar.h> and thus compatible to the definition
    of of_char{16,32}_t. The reason for not defining of_char{16,32}_t to
    char{16,32}_t when using C11 is that <uchar.h> might be missing and that
    char{16,32}_t are not required to be UTF-{16,32}, whereas in C++, they
    are required to be UTF-{16,32}. (user: js, size: 50107) [annotate] [blame] [check-ins using]

To Artifact [a4fa320751]:


2220
2221
2222
2223
2224
2225
2226







2227
2228
2229
2230
2231
2232


2233
2234
2235
2236
2237
2238
2239
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238

2239
2240
2241
2242
2243
2244
2245
2246
2247







+
+
+
+
+
+
+





-
+
+







	}

	return ret;
}

- (void)writeToFile: (OFString*)path
{
	return [self writeToFile: path
			encoding: OF_STRING_ENCODING_UTF_8];
}

- (void)writeToFile: (OFString*)path
	   encoding: (of_string_encoding_t)encoding
{
	void *pool = objc_autoreleasePoolPush();
	OFFile *file;

	file = [OFFile fileWithPath: path
			       mode: @"wb"];
	[file writeString: self];
	[file writeString: self
		 encoding: encoding];

	objc_autoreleasePoolPop(pool);
}

#ifdef OF_HAVE_BLOCKS
- (void)enumerateLinesUsingBlock: (of_string_line_enumeration_block_t)block
{