MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / CharArrayInputBuffer

Class CharArrayInputBuffer

Source/external/hps/buffer/char_array_input_buffer.h:9–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7namespace hps {
8
9class CharArrayInputBuffer {
10 public:
11 CharArrayInputBuffer(const char* arr) : arr(arr) { pos = 0; }
12
13 void read(char* content, size_t length) {
14 strncpy(content, &arr[pos], length);
15 pos += length;
16 }
17
18 char read_char() {
19 const char ch = arr[pos];
20 pos++;
21 return ch;
22 }
23
24 template <class T>
25 CharArrayInputBuffer& operator>>(T& t) {
26 Serializer<T, CharArrayInputBuffer>::parse(t, *this);
27 return *this;
28 }
29
30 private:
31 const char* const arr;
32
33 size_t pos;
34};
35
36} // namespace hps
37#endif

Callers

nothing calls this directly

Calls 1

parseFunction · 0.85

Tested by

no test coverage detected