#include "IMFText.h" #include namespace coreutils { IMFText::IMFText(int fd, ZString boundary) : MString() { int ch = 0; int rc = 0; char *endcursor; char *index = boundary.getData(); while(1) { rc = ::read(fd, &ch, 1); if(ch == *index) { ++index; ZString check(index, index - endcursor); if(check == boundary) { break; } } else { endcursor = index; } write(ch); } } }