ObjFW  Diff

Differences From Artifact [7dd17fb763]:

  • File src/OFExceptions.h — part of check-in [c83137e7cd] at 2008-12-11 13:43:35 on branch trunk — Remove - close from OFStream protocol.
    The reason is that closing a file isn't too useful, because an OFFile
    object can't be reused, whereas an OFTCPSocket can. So only the
    OFTCPSocket should have closed. Plus, we don't need to handle the case
    that someone tried to read from / write to a closed OFFile. (user: js, size: 6563) [annotate] [blame] [check-ins using]

To Artifact [bd5ad34ccf]:


201
202
203
204
205
206
207

208
209
210
211
212
213
214
215
216
217
218
219
220
221










222
223
224
225
226
227
228
229
230
231
232
233










234
235
236
237
238
239
240
/**
 * An OFException indicating a read or write to the file failed.
 */
@interface OFReadOrWriteFailedException: OFException
{
	size_t req_size;
	size_t req_items;

}

/**
 * Creates a new read or write failed exception.
 *
 * \param obj The object which caused the exception
 * \param size The requested size of the data that couldn't be read / written
 * \param nitems The requested number of items that couldn't be read / written
 * \return A new open file failed exception
 */
+ newWithObject: (id)obj
	andSize: (size_t)size
      andNItems: (size_t)nitems;











/**
 * Initializes an already allocated read or write failed exception.
 *
 * \param obj The object which caused the exception
 * \param size The requested size of the data that couldn't be read / written
 * \param nitems The requested number of items that couldn't be read / written
 * \return A new open file failed exception
 */
- initWithObject: (id)obj
	 andSize: (size_t)size
       andNItems: (size_t)nitems;











/**
 * \return The requested size of the data that couldn't be read / written
 */
- (size_t)requestedSize;

/**
 * \return The requested number of items that coudln't be read / written







>














>
>
>
>
>
>
>
>
>
>












>
>
>
>
>
>
>
>
>
>







201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
/**
 * An OFException indicating a read or write to the file failed.
 */
@interface OFReadOrWriteFailedException: OFException
{
	size_t req_size;
	size_t req_items;
	BOOL has_items;
}

/**
 * Creates a new read or write failed exception.
 *
 * \param obj The object which caused the exception
 * \param size The requested size of the data that couldn't be read / written
 * \param nitems The requested number of items that couldn't be read / written
 * \return A new open file failed exception
 */
+ newWithObject: (id)obj
	andSize: (size_t)size
      andNItems: (size_t)nitems;

/**
 * Creates a new read or write failed exception.
 *
 * \param obj The object which caused the exception
 * \param size The requested size of the data that couldn't be read / written
 * \return A new open file failed exception
 */
+ newWithObject: (id)obj
	andSize: (size_t)size;

/**
 * Initializes an already allocated read or write failed exception.
 *
 * \param obj The object which caused the exception
 * \param size The requested size of the data that couldn't be read / written
 * \param nitems The requested number of items that couldn't be read / written
 * \return A new open file failed exception
 */
- initWithObject: (id)obj
	 andSize: (size_t)size
       andNItems: (size_t)nitems;

/**
 * Initializes an already allocated read or write failed exception.
 *
 * \param obj The object which caused the exception
 * \param size The requested size of the data that couldn't be read / written
 * \return A new open file failed exception
 */
- initWithObject: (id)obj
	 andSize: (size_t)size;

/**
 * \return The requested size of the data that couldn't be read / written
 */
- (size_t)requestedSize;

/**
 * \return The requested number of items that coudln't be read / written