| 647 | // ---------------------------------------------------------------------- |
| 648 | |
| 649 | struct ByteArray { |
| 650 | ByteArray() : len(0), ptr(NULLPTR) {} |
| 651 | ByteArray(uint32_t len, const uint8_t* ptr) : len(len), ptr(ptr) {} |
| 652 | |
| 653 | ByteArray(::std::string_view view) // NOLINT implicit conversion |
| 654 | : ByteArray(static_cast<uint32_t>(view.size()), |
| 655 | reinterpret_cast<const uint8_t*>(view.data())) {} |
| 656 | |
| 657 | explicit operator std::string_view() const { |
| 658 | return std::string_view{reinterpret_cast<const char*>(ptr), len}; |
| 659 | } |
| 660 | |
| 661 | uint32_t len; |
| 662 | const uint8_t* ptr; |
| 663 | }; |
| 664 | |
| 665 | inline bool operator==(const ByteArray& left, const ByteArray& right) { |
| 666 | return left.len == right.len && |
no outgoing calls