|
Monado OpenXR Runtime
|
A builder for constructing ExtensionList objects. More...
#include <util/u_extension_list.hpp>
Public Member Functions | |
| ExtensionListBuilder ()=default | |
| Default constructor. More... | |
| ExtensionListBuilder (uint32_t capacity) | |
| Construct with capacity hint. More... | |
| template<uint32_t N> | |
| ExtensionListBuilder (const char *(&arr)[N]) | |
| Construct from an array of strings. More... | |
| ExtensionListBuilder (ExtensionListBuilder &&)=delete | |
| ExtensionListBuilder (ExtensionListBuilder const &)=delete | |
| ExtensionListBuilder & | operator= (ExtensionListBuilder &&)=delete |
| ExtensionListBuilder & | operator= (ExtensionListBuilder const &)=delete |
| void | append (std::string_view str) |
| Append a new string to the builder. More... | |
| bool | appendUnique (std::string_view str) |
| Append a new string to the builder if it doesn't match any existing string. More... | |
| void | sortForExtensions () |
| Sort the strings in the builder suitable for extension lists. More... | |
| ExtensionList | build () && |
| Build and return an immutable ExtensionList. More... | |
A builder for constructing ExtensionList objects.
This class allows write-only operations to build up an extension list, which can then be converted to an immutable ExtensionList.
|
default |
Default constructor.
|
inlineexplicit |
Construct with capacity hint.
|
inlineexplicit |
Construct from an array of strings.
References append().
|
inline |
Append a new string to the builder.
| str | a string view to append. |
| std::out_of_range | if you have a ridiculous number of strings in your list already. |
Referenced by ExtensionListBuilder(), and u_extension_list::u_extension_list_create_from_array().
|
inline |
Append a new string to the builder if it doesn't match any existing string.
(Comparing string contents)
| str | a string view to append. |
| std::out_of_range | if you have a ridiculous number of strings in your list already. |
|
inline |
Build and return an immutable ExtensionList.
This function consumes the builder by moving its internal data into the returned ExtensionList. After calling this, the builder is left in a valid but empty state.
The && qualifier (rvalue reference qualifier) means this can only be called on rvalue references, i.e. on:
ExtensionListBuilder().build()std::move(builder).build()This prevents accidentally calling build() twice on the same builder, which would be a bug.
| void ExtensionListBuilder::sortForExtensions | ( | ) |
Sort the strings in the builder suitable for extension lists.
The list will be sorted first by API (VK, XR, etc.), then all KHR extensions, then all EXT extensions, then all Vendor extensions, then all experimental extensions. (Alphabetical within each group.)
This modifies the builder in-place.
References get_extension_sort_key().