Overview
Comment: | OFStream: Use lowlevel as prefix instead of _. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
61c1932cafe507b85cd66894706e4b5b |
User & Date: | js on 2012-09-16 15:43:45 |
Other Links: | manifest | tags |
Context
2012-09-16
| ||
21:59 | Make it possible to invalidate OFTimers. check-in: 8658d1a22a user: js tags: trunk | |
15:43 | OFStream: Use lowlevel as prefix instead of _. check-in: 61c1932caf user: js tags: trunk | |
15:27 | Prefix all private methods with OF_. check-in: c137da5e5b user: js tags: trunk | |
Changes
Modified src/OFFile.m from [f9e4a0a447] to [a11a54fb53].
︙ | |||
681 682 683 684 685 686 687 | 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 | - + - - + + - - + + - + - + - + | self = [super init]; fd = fileDescriptor; return self; } |
︙ | |||
819 820 821 822 823 824 825 | 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 | - + - + - + | - (void)dealloc { @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; [super dealloc]; /* Get rid of stupid warning */ } |
Modified src/OFProcess.m from [fe517b8418] to [7f1558d0a7].
︙ | |||
221 222 223 224 225 226 227 | 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 | - + - - + + | [self release]; @throw e; } return self; } |
︙ | |||
265 266 267 268 269 270 271 | 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | - - + + | if (ret == 0) atEndOfStream = YES; return ret; } |
︙ |
Modified src/OFSeekableStream.h from [7d6bf274be] to [38bd04ae73].
︙ | |||
24 25 26 27 28 29 30 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | - - - - - - + + + + + + + | #include <sys/types.h> #import "OFStream.h" /** * \brief A stream that supports seeking. * |
︙ | |||
54 55 56 57 58 59 60 61 | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | /** * \brief Seeks to the specified offset, relative to the end of the stream. * * \param offset The offset relative to the end of the stream * \return The absolute offset */ - (off_t)seekToOffsetRelativeToEnd: (off_t)offset; /** * \brief Seek the stream on the lowlevel. * * \warning Do not call this directly! * * Override this with this method with your actual seek implementation when * subclassing! * * \param offset The offset to seek to */ - (void)lowlevelSeekToOffset: (off_t)offset; /** * \brief Seek the stream on the lowlevel. * * \warning Do not call this directly! * * Override this with this method with your actual seek implementation when * subclassing! * * \param offset The offset to seek forward to */ - (off_t)lowlevelSeekForwardWithOffset: (off_t)offset; /** * \brief Seek the stream on the lowlevel. * * \warning Do not call this directly! * * Override this with this method with your actual seek implementation when * subclassing! * * \param offset The offset to seek to, relative to the end */ - (off_t)lowlevelSeekToOffsetRelativeToEnd: (off_t)offset; @end |
Modified src/OFSeekableStream.m from [e3dd88a6e5] to [3a3c16de1f].
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | - + - + - + - + - + - + | */ #import "OFSeekableStream.h" #import "OFNotImplementedException.h" @implementation OFSeekableStream |
Modified src/OFStream.h from [1a309ecdea] to [67eb3e5d0e].
︙ | |||
40 41 42 43 44 45 46 | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | - - - - - - + + + + + + | * \warning Even though the OFCopying protocol is implemented, it does * <i>not</i> return an independent copy of the stream, but instead * retains it. This is so that the stream can be used as a key for a * dictionary, so context can be associated with a stream. Using a * stream in more than one thread at the same time is not thread-safe, * even if copy was called to create one "instance" for every thread! * |
︙ | |||
879 880 881 882 883 884 885 | 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 | + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + | - (int)fileDescriptorForWriting; /** * \brief Closes the stream. */ - (void)close; /** * \brief Performs a lowlevel read. * * \warning Do not call this directly! * * Override this method with your actual read implementation when subclassing! * * \param buffer The buffer for the data to read * \param length The length of the buffer * \return The number of bytes read */ |
Modified src/OFStream.m from [c9efb96401] to [92797b60e4].
︙ | |||
67 68 69 70 71 72 73 | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | - + - - + + - - + + - + - - + + | cache = NULL; writeBuffer = NULL; blocking = YES; return self; } |
︙ | |||
558 559 560 561 562 563 564 | 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 | - + | } } /* Read and see if we get a newline or \0 */ buffer = [self allocMemoryWithSize: of_pagesize]; @try { |
︙ | |||
581 582 583 584 585 586 587 | 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 | - - + + | cache = NULL; cacheLength = 0; waitingForDelimiter = NO; return ret; } |
︙ | |||
754 755 756 757 758 759 760 | 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 | - + - - + + | } } /* Read and see if we get a delimiter or \0 */ buffer = [self allocMemoryWithSize: of_pagesize]; @try { |
︙ | |||
887 888 889 890 891 892 893 | 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 | - - + + - - + + | } - (void)flushWriteBuffer { if (writeBuffer == NULL) return; |
︙ |
Modified src/OFStreamSocket.m from [fbc78fae5c] to [b406096bcb].
︙ | |||
61 62 63 64 65 66 67 | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | - + - - + + | #endif + socket { return [[[self alloc] init] autorelease]; } |
︙ | |||
101 102 103 104 105 106 107 | 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | - - + + | if (ret == 0) atEndOfStream = YES; return ret; } |
︙ |
Modified tests/OFStreamTests.m from [cf598bf19b] to [6be1a5b957].
︙ | |||
29 30 31 32 33 34 35 | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | - + - - + + | @interface StreamTester: OFStream { int state; } @end @implementation StreamTester |
︙ |