ObjFW  Diff

Differences From Artifact [47b9cf3e36]:

To Artifact [cca724d404]:


672
673
674
675
676
677
678























679
680
681
682
683
684
685
672
673
674
675
676
677
678
679
680
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







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







 * @return OFData with an item size of 1 with all the data of the stream until
 *	   the end of the stream is reached.
 * @throw OFReadFailedException Reading failed
 * @throw OFNotOpenException The stream is not open
 */
- (OFData *)readDataUntilEndOfStream;

/**
 * @brief Reads a string until a `\0` appears in the stream or the end of the
 *	  stream is reached.
 *
 * @throw OFReadFailedException Reading failed
 * @throw OFInvalidEncodingException The string read from the stream has
 *				     invalid encoding
 * @throw OFNotOpenException The stream is not open
 */
- (OFString *)readString;

/**
 * @brief Reads a string with the specified encoding until a `\0` appears in
 *	  the stream or the end of the stream is reached.
 *
 * @param encoding The encoding of the string to read from the stream
 * @throw OFReadFailedException Reading failed
 * @throw OFInvalidEncodingException The string read from the stream has
 *				     invalid encoding
 * @throw OFNotOpenException The stream is not open
 */
- (OFString *)readStringWithEncoding: (OFStringEncoding)encoding;

/**
 * @brief Reads a string with the specified length from the stream.
 *
 * If `\0` appears in the stream, the string will be truncated at the `\0` and
 * the rest of the bytes of the string will be lost. This way, reading from the
 * stream will not break because of a `\0` because the specified number of
 * bytes is still being read and only the string gets truncated.
832
833
834
835
836
837
838























839
840
841
842
843
844
845
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







 */
- (void)asyncReadLineWithEncoding: (OFStringEncoding)encoding
		      runLoopMode: (OFRunLoopMode)runLoopMode
			    block: (OFStreamAsyncReadLineBlock)block;
# endif
#endif

/**
 * @brief Tries to read a string until a `\0` appears in the stream or the end
 *	  of the stream is reached.
 *
 * @throw OFReadFailedException Reading failed
 * @throw OFInvalidEncodingException The string read from the stream has
 *				     invalid encoding
 * @throw OFNotOpenException The stream is not open
 */
- (OFString *)tryReadString;

/**
 * @brief Tries to read a string with the specified encoding until a `\0`
 *	  appears in the stream or the end of the stream is reached.
 *
 * @param encoding The encoding of the string to read from the stream
 * @throw OFReadFailedException Reading failed
 * @throw OFInvalidEncodingException The string read from the stream has
 *				     invalid encoding
 * @throw OFNotOpenException The stream is not open
 */
- (OFString *)tryReadStringWithEncoding: (OFStringEncoding)encoding;

/**
 * @brief Tries to read a line from the stream (see @ref readLine) and returns
 *	  `nil` if no complete line has been received yet.
 *
 * @return The line that was read, autoreleased, or `nil` if the line is not
 *	   complete yet
 * @throw OFReadFailedException Reading failed