ObjFW  Check-in [967a5e6a40]

Overview
Comment:Add -[writeDataArray:] to OFStream.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 967a5e6a40e30f69da22edb1268a86340871fe3f60f3acfba7fe5bd3d514b994
User & Date: js on 2010-04-08 21:23:45
Other Links: manifest | tags
Context
2010-04-08
23:10
Add -[readExactlyNBytes:intoBuffer:] to OFStream. check-in: 96c8753847 user: js tags: trunk
21:23
Add -[writeDataArray:] to OFStream. check-in: 967a5e6a40 user: js tags: trunk
21:22
Extra parentheses for OF_BSWAP{16,32,64}_CONST. check-in: 8fa3b3b737 user: js tags: trunk
Changes

Modified src/OFStream.h from [ed7d8ab9b7] to [6261e9a8b9].

124
125
126
127
128
129
130








131
132
133
134
135
136
137
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145







+
+
+
+
+
+
+
+







 * \param buf The buffer from which the data is written to the stream
 * \param size The size of the data that should be written
 * \return The number of bytes written
 */
- (size_t)writeNBytes: (size_t)size
	   fromBuffer: (const char*)buf;

/**
 * Writes from an OFDataArray into the stream.
 *
 * \param dataarray The OFDataArray to write into the stream
 * \return The number of bytes written
 */
- (size_t)writeDataArray: (OFDataArray*)dataarray;

/**
 * Writes a string into the stream, without the trailing zero.
 *
 * \param str The string from which the data is written to the stream
 * \return The number of bytes written
 */
- (size_t)writeString: (OFString*)str;

Modified src/OFStream.m from [a719ab966a] to [37b3e2e00f].

388
389
390
391
392
393
394






395
396
397
398
399
400
401
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407







+
+
+
+
+
+








- (size_t)writeNBytes: (size_t)size
	   fromBuffer: (const char*)buf
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
}

- (size_t)writeDataArray: (OFDataArray*)dataarray
{
	return [self writeNBytes: [dataarray count] * [dataarray itemSize]
		      fromBuffer: [dataarray cArray]];
}

- (size_t)writeString: (OFString*)str
{
	return [self writeNBytes: [str cStringLength]
		      fromBuffer: [str cString]];
}