| 655 | // ---------------------------------------------------------------------- |
| 656 | |
| 657 | struct ByteArray { |
| 658 | ByteArray() : len(0), ptr(NULLPTR) {} |
| 659 | ByteArray(uint32_t len, const uint8_t* ptr) : len(len), ptr(ptr) {} |
| 660 | |
| 661 | ByteArray(::std::string_view view) // NOLINT implicit conversion |
| 662 | : ByteArray(static_cast<uint32_t>(view.size()), |
| 663 | reinterpret_cast<const uint8_t*>(view.data())) {} |
| 664 | |
| 665 | explicit operator std::string_view() const { |
| 666 | return std::string_view{reinterpret_cast<const char*>(ptr), len}; |
| 667 | } |
| 668 | |
| 669 | uint32_t len; |
| 670 | const uint8_t* ptr; |
| 671 | }; |
| 672 | |
| 673 | inline bool operator==(const ByteArray& left, const ByteArray& right) { |
| 674 | return left.len == right.len && |
no outgoing calls