@@ -39,10 +39,14 @@ OF_STRING_ENCODING_AUTODETECT = 0xFF } of_string_encoding_t; /* FIXME */ #define OF_STRING_ENCODING_NATIVE OF_STRING_ENCODING_UTF_8 + +#ifdef OF_HAVE_BLOCKS +typedef void (^of_string_line_enumeration_block_t)(OFString *line, BOOL *stop); +#endif #ifdef __cplusplus extern "C" { #endif extern int of_string_check_utf8(const char*, size_t, size_t*); @@ -797,14 +801,23 @@ * \brief Writes the string into the specified file using UTF-8 encoding. * * \param path The path of the file to write to */ - (void)writeToFile: (OFString*)path; + +#ifdef OF_HAVE_BLOCKS +/** + * Enumerates all lines in the receiver using the specified block. + * + * \brief block The block to call for each line + */ +- (void)enumerateLinesUsingBlock: (of_string_line_enumeration_block_t)block; +#endif @end #import "OFConstantString.h" #import "OFMutableString.h" #import "OFString+Hashing.h" #import "OFString+Serialization.h" #import "OFString+URLEncoding.h" #import "OFString+XMLEscaping.h" #import "OFString+XMLUnescaping.h"