# Platform Notes

> UStore for C++

### Strings

A `strings_collection_t` keys arbitrary bytes by variable-length strings, kept in the order of their text:

```cpp
auto [words, status] = db.create<strings_collection_t>("words");
status = words.assign("apple", "red");
status = words.assign("apricot", "orange");

expected<owned_value_t> apple = words.value("apple");
std::array<value_view_t, 2> const asked {"apple", "cherry"};
expected<values_view_t> found = words.read(asked, arena);
expected<sz::strings_view_t> page = words.prefixed_page("ap", 16, arena);
expected<std::size_t> count = words.size("ap");
```

`value` and `present` of one string are shorthand, while `read` and `prefixed_page` export into the arena they are given.
`prefixed` and `prefix_begin` stream every string of a prefix through one arena of their own, pulling pages from a `strings_cursor_t`.

