Continued work on Parser.
This commit is contained in:
1 parent
d54aec1f06
commit
0243468d44
4 files changed
+38
-8
No files matched your search
+21
-2
@@ -5,7 +5,26 @@
|
||||
namespace coreutils {
|
||||
|
||||
IMFBoundary(StreamReader &reader, ZString boundary) : boundary(boundary) {
|
||||
if(reader.unparsed().getLength()
|
||||
|
||||
}
|
||||
|
||||
|
||||
int IMFBoundary::parse() {
|
||||
switch(state) {
|
||||
case PREFIX:
|
||||
if(buffer.remaining() > 3)
|
||||
if(reader.nextIf("\r\n--"))
|
||||
state = BOUNDARY;
|
||||
case BOUNDARY:
|
||||
while(buffer.getTokenInclude(""));
|
||||
if(buffer.eod())
|
||||
return 2;
|
||||
else if(buffer.remaining() > 1)
|
||||
if(buffer.ifNext("--"))
|
||||
state = LAST_BOUNDARY;
|
||||
case LAST_BOUNDARY:
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user