Unit tests for SmartRest
Dependencies: C027 SmartRest mbed
Diff: mock/BufferedDataSource.h
- Revision:
- 0:789029e49ea1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mock/BufferedDataSource.h Mon Mar 24 10:12:45 2014 +0000 @@ -0,0 +1,25 @@ +#ifndef BUFFEREDDATASOURCE_H +#define BUFFEREDDATASOURCE_H + +#include <stddef.h> +#include <AbstractDataSource.h> + +class BufferedDataSource : public AbstractDataSource +{ +public: + BufferedDataSource(); + + void set(char *buf, size_t length); + void set(const char *str); + void clear(); + + bool exhausted(); + char read(); + uint8_t status(); + +private: + char *_data, *_ptr; + size_t _length; +}; + +#endif