Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Add -[fileDescriptor] to OFStream. |
|---|---|
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
9d064462a331e92a4abe5ec96c41d4df |
| User & Date: | js 2010-07-07 20:46:43.000 |
Context
|
2010-07-07
| ||
| 20:48 | Rename OFSocketObserver to OFStreamObserver and make it more general. check-in: 52dcb22b8c user: js tags: trunk | |
| 20:46 | Add -[fileDescriptor] to OFStream. check-in: 9d064462a3 user: js tags: trunk | |
|
2010-07-03
| ||
| 17:28 | Import OFXMLElementBuilder in ObjFW.h. check-in: bc26452995 user: js tags: trunk | |
Changes
Changes to src/Makefile.
| ︙ | ︙ | |||
21 22 23 24 25 26 27 |
OFMutableString.m \
OFNumber.m \
OFObject.m \
${OFPLUGIN_M} \
OFSeekableStream.m \
OFSHA1Hash.m \
OFSocket.m \
| < > | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
OFMutableString.m \
OFNumber.m \
OFObject.m \
${OFPLUGIN_M} \
OFSeekableStream.m \
OFSHA1Hash.m \
OFSocket.m \
OFStream.m \
OFStreamObserver.m \
OFString.m \
OFString+Hashing.m \
OFString+URLEncoding.m \
OFString+XMLEscaping.m \
OFString+XMLUnescaping.m \
OFTCPSocket.m \
${OFTHREAD_M} \
|
| ︙ | ︙ |
Changes to src/OFFile.h.
| ︙ | ︙ | |||
17 18 19 20 21 22 23 |
@class OFArray;
/**
* \brief A class which provides functions to read, write and manipulate files.
*/
@interface OFFile: OFSeekableStream
{
| | | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
@class OFArray;
/**
* \brief A class which provides functions to read, write and manipulate files.
*/
@interface OFFile: OFSeekableStream
{
int fd;
BOOL closable;
BOOL eos;
}
/**
* \param path The path to the file to open as a string
* \param mode The mode in which the file should be opened as a string
|
| ︙ | ︙ |
Changes to src/OFFile.m.
| ︙ | ︙ | |||
512 513 514 515 516 517 518 519 520 521 522 523 524 525 |
off_t ret;
if ((ret = lseek(fd, offset, SEEK_END)) == -1)
@throw [OFSeekFailedException newWithClass: isa];
return ret;
}
- (void)close
{
if (fd != -1)
close(fd);
fd = -1;
}
| > > > > > | 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 |
off_t ret;
if ((ret = lseek(fd, offset, SEEK_END)) == -1)
@throw [OFSeekFailedException newWithClass: isa];
return ret;
}
- (int)fileDescriptor
{
return fd;
}
- (void)close
{
if (fd != -1)
close(fd);
fd = -1;
}
|
| ︙ | ︙ |
Changes to src/OFSocket.m.
| ︙ | ︙ | |||
115 116 117 118 119 120 121 122 | #else u_long v = enable; if (ioctlsocket(sock, FIONBIO, &v) == SOCKET_ERROR) @throw [OFSetOptionFailedException newWithClass: isa]; #endif } @end | > > > > > | 115 116 117 118 119 120 121 122 123 124 125 126 127 |
#else
u_long v = enable;
if (ioctlsocket(sock, FIONBIO, &v) == SOCKET_ERROR)
@throw [OFSetOptionFailedException newWithClass: isa];
#endif
}
- (int)fileDescriptor
{
return sock;
}
@end
|
Changes to src/OFStream.h.
| ︙ | ︙ | |||
301 302 303 304 305 306 307 308 309 310 311 312 | * \param fmt A string used as format * \param args The arguments used in the format string * \return The number of bytes written */ - (size_t)writeFormat: (OFString*)fmt withArguments: (va_list)args; /** * Closes the stream. */ - (void)close; @end | > > > > > | 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | * \param fmt A string used as format * \param args The arguments used in the format string * \return The number of bytes written */ - (size_t)writeFormat: (OFString*)fmt withArguments: (va_list)args; /** * \return The file descriptor for the stream. */ - (int)fileDescriptor; /** * Closes the stream. */ - (void)close; @end |
Changes to src/OFStream.m.
| ︙ | ︙ | |||
643 644 645 646 647 648 649 650 651 652 653 654 655 656 |
} @finally {
free(t);
}
/* Get rid of a warning, never reached anyway */
assert(0);
}
- (void)close
{
@throw [OFNotImplementedException newWithClass: isa
selector: _cmd];
}
@end
| > > > > > > | 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 |
} @finally {
free(t);
}
/* Get rid of a warning, never reached anyway */
assert(0);
}
- (int)fileDescriptor
{
@throw [OFNotImplementedException newWithClass: isa
selector: _cmd];
}
- (void)close
{
@throw [OFNotImplementedException newWithClass: isa
selector: _cmd];
}
@end
|
Changes to tests/OFXMLElementBuilderTests.m.
| ︙ | ︙ | |||
10 11 12 13 14 15 16 | */ #include "config.h" #include <string.h> #include <assert.h> | | > | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | */ #include "config.h" #include <string.h> #include <assert.h> #import "OFXMLElement.h" #import "OFXMLParser.h" #import "OFXMLElementBuilder.h" #import "OFAutoreleasePool.h" #import "TestsAppDelegate.h" static OFString *module = @"OFXMLElementBuilder"; static OFXMLElement *elem = nil; |
| ︙ | ︙ |