ObjFW  Diff

Differences From Artifact [0b28d6c4b4]:

To Artifact [e3b833eee4]:

  • File src/OFFile.m — 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: 3186) [annotate] [blame] [check-ins using]

75
76
77
78
79
80
81

82
83
84
85
86
87
88
	}
	return self;
}

- free
{
	fclose(fp);

	return [super free];
}

- (BOOL)atEndOfFile
{
	return (feof(fp) == 0 ? NO : YES);
}







>







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
	}
	return self;
}

- free
{
	fclose(fp);

	return [super free];
}

- (BOOL)atEndOfFile
{
	return (feof(fp) == 0 ? NO : YES);
}
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177

- (size_t)writeCString: (const char*)str
{
	return [self writeNItems: strlen(str)
			  ofSize: 1
		      fromBuffer: (const uint8_t*)str];
}

- close
{
	if (fclose(fp)) {
		/* FIXME: Throw exception */
		return nil;
	}

	return self;
}
@end







<
<
<
<
<
<
<
<
<
<

161
162
163
164
165
166
167










168

- (size_t)writeCString: (const char*)str
{
	return [self writeNItems: strlen(str)
			  ofSize: 1
		      fromBuffer: (const uint8_t*)str];
}










@end