|
| SPARROW_API | key_value_view (const char *ptr) |
| | Constructs a view over the given binary metadata buffer.
|
| SPARROW_API key_value_view_iterator | cbegin () const |
| | Gets const iterator to the beginning of the metadata pairs.
|
| SPARROW_API key_value_view_iterator | begin () const |
| | Gets iterator to the beginning of the metadata pairs.
|
| SPARROW_API key_value_view_iterator | cend () const |
| | Gets const iterator to the end of the metadata pairs.
|
| SPARROW_API key_value_view_iterator | end () const |
| | Gets iterator to the end of the metadata pairs.
|
| SPARROW_API size_t | size () const |
| | Gets the number of key-value pairs in the metadata.
|
| SPARROW_API bool | empty () const |
| SPARROW_API key_value_view_iterator | find (std::string_view key) const |
Custom view for lazily extracting key-value pairs from a binary buffer.
This class provides a range-like interface over metadata stored in binary format. It implements lazy extraction, meaning key-value pairs are only parsed when accessed through iteration. This approach is memory-efficient and allows processing of large metadata sets without upfront parsing overhead.
The binary format consists of:
- int32_t: number of key-value pairs
- For each pair:
- int32_t: key length
- char[]: key data
- int32_t: value length
- char[]: value data
- Precondition
- Input buffer must be valid and properly formatted
-
Buffer must remain valid for the lifetime of the view and its iterators
- Postcondition
- Provides range-compatible interface for metadata iteration
-
Supports both const and non-const iteration
Definition at line 230 of file metadata.hpp.