src/lib/AbstractParser.cpp
branchv_0
changeset 13 d5e2cb9e31f1
parent 10 6904e4448807
child 14 02725d301010
equal deleted inserted replaced
12:243ef6c91dbb 13:d5e2cb9e31f1
    43 
    43 
    44 AbstractParser::~AbstractParser() {
    44 AbstractParser::~AbstractParser() {
    45 	delete implementation;
    45 	delete implementation;
    46 }
    46 }
    47 
    47 
    48 void AbstractParser::write(const char* buffer, const size_t length) {
    48 void AbstractParser::write(const uint8_t* buffer, const size_t length) {
    49 	try {
    49 	try {
    50 		// TODO: do not write to the buffer, just append in read()/peek() and write just the part that was not read during this cycle
    50 		// TODO: do not write to the buffer, just append in read()/peek() and write just the part that was not read during this cycle
    51 		implementation->buffer.write(buffer, length);
    51 		implementation->buffer.write(buffer, length);
    52 
    52 
    53 		// TODO: call an overridable method to get preferred minimum block size and run cycle only if we have enough data or EOF
    53 		// TODO: call an overridable method to get preferred minimum block size and run cycle only if we have enough data or EOF
    72 
    72 
    73 void AbstractParser::commit() {
    73 void AbstractParser::commit() {
    74 	implementation->buffer.commitRead();
    74 	implementation->buffer.commitRead();
    75 }
    75 }
    76 
    76 
    77 void AbstractParser::read(char* buffer, const size_t length) {
    77 void AbstractParser::read(uint8_t* buffer, const size_t length) {
    78 	implementation->buffer.read(buffer, length);
    78 	implementation->buffer.read(buffer, length);
    79 }
    79 }
    80 
    80 
    81 void AbstractParser::peek(char* buffer, const size_t length) {
    81 void AbstractParser::peek(uint8_t* buffer, const size_t length) {
    82 	implementation->buffer.read(buffer, length);
    82 	implementation->buffer.read(buffer, length);
    83 }
    83 }
    84 
    84 
    85 }
    85 }
    86 }
    86 }