A few cleanups and quality-of-life improvements for GVariantRef:
* Remove iteration functionality from gvariant::Type. It was not
entirely obvious what iterating should mean for a type string.
Explicitly getting a string_view to iterate makes it clear that one
is iterating characters.
* Update various usages of pointers to instead use std::string_views or
base::spans in gvariant::Type.
* Add GVariantFrom() helper function to infer the GVariant type string
from the passed C++ types. E.g., GVariantFrom("foo") returns a
GVariantRef<"s">.
* Add BoxedRef() and FilledMaybeRef() helper functions to more easily
wrap a reference to an existing value.
* Introduce ObjectPathCStr and TypeSignatureCStr, which reference an
unowned string that is known to be a valid object path or type
signature, respectively. They can reference a constant string (which
will be verified at compile time to be valid) or an owned ObjectPath
or TypeSignature object, and are thus useful as function parameters.
Bug: 378932951
Change-Id: Idf625de0caf5b711c477da12d34a0d2a0a2306b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6334519
Commit-Queue: Erik Jensen <rkjnsn@chromium.org>
Reviewed-by: Lambros Lambrou <lambroslambrou@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1431759}