| 30 | class Writer; |
| 31 | |
| 32 | class ContentReader { |
| 33 | public: |
| 34 | ContentReader() = default; |
| 35 | ContentReader(const std::shared_ptr<Reader>&, |
| 36 | const OnInvalidData on_invalid_data = kIgnore); |
| 37 | ContentReader& operator=(ContentReader&&) noexcept; |
| 38 | |
| 39 | bool isOpen(); |
| 40 | void close(); |
| 41 | std::string read(); |
| 42 | |
| 43 | private: |
| 44 | bool scan(const uint8_t* seq, size_t len); |
| 45 | bool scan(const char* str); |
| 46 | bool match(const uint8_t* seq, size_t len); |
| 47 | bool match(const char* str); |
| 48 | char matchAny(const char* chars); |
| 49 | bool buffer(size_t bytes); |
| 50 | std::string badHeader(); |
| 51 | |
| 52 | std::shared_ptr<Reader> reader; |
| 53 | std::deque<uint8_t> buf; |
| 54 | OnInvalidData on_invalid_data; |
| 55 | }; |
| 56 | |
| 57 | class ContentWriter { |
| 58 | public: |
no outgoing calls
no test coverage detected
searching dependent graphs…