A Source implementation that yields the contents of a flat array
| 144 | |
| 145 | // A Source implementation that yields the contents of a flat array |
| 146 | class ByteArraySource : public Source { |
| 147 | public: |
| 148 | ByteArraySource(const char* p, size_t n) : ptr_(p), left_(n) { } |
| 149 | ~ByteArraySource() override; |
| 150 | size_t Available() const override; |
| 151 | const char* Peek(size_t* len) override; |
| 152 | void Skip(size_t n) override; |
| 153 | private: |
| 154 | const char* ptr_; |
| 155 | size_t left_; |
| 156 | }; |
| 157 | |
| 158 | // A Sink implementation that writes to a flat array without any bound checks. |
| 159 | class UncheckedByteArraySink : public Sink { |
nothing calls this directly
no outgoing calls
no test coverage detected