some smart buffer work.
This commit is contained in:
1 parent
f35fa12902
commit
fd7a9ed860
14 files changed
+109
-142
No files matched your search
@@ -0,0 +1,32 @@
|
||||
#include "IMFHeaderField.h"
|
||||
#include "Exception.h"
|
||||
#include "Log.h"
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
namespace coreutils {
|
||||
|
||||
IMFHeaderField::IMFHeaderField(char &ch, int fd) {
|
||||
int rc = 0;
|
||||
|
||||
if((ch >= 'A') && (ch <= 'Z'))
|
||||
key.write();
|
||||
|
||||
while(ch != ':') {
|
||||
rc = ::read(fd, &ch, 1);
|
||||
if(ch != ':')
|
||||
key.write(ch);
|
||||
}
|
||||
rc = ::read(fd, &ch, 1);
|
||||
while(ch == ' ')
|
||||
rc = ::read(fd, &ch, 1);
|
||||
|
||||
while(ch != '\r') {
|
||||
rc = ::read(fd, &ch, 1);
|
||||
if(ch != '\r')
|
||||
value.write(ch);
|
||||
}
|
||||
rc = ::read(fd, &ch, 1);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user