|
Monado OpenXR Runtime
|
Path store structure for managing path storage and lookup. More...
#include <oxr/path/oxr_path_store.h>

Public Member Functions | |
| XrResult | oxr_path_store_init (struct oxr_path_store *store) |
| Initialize the path store. | |
| void | oxr_path_store_fini (struct oxr_path_store *store) |
| Destroy the path store and all paths. | |
| bool | oxr_path_store_is_valid (struct oxr_logger *log, const struct oxr_path_store *store, XrPath xr_path) |
| Check if a path ID is valid. | |
| XrResult | oxr_path_store_get_or_create (struct oxr_path_store *store, const char *str, size_t length, XrPath *out_path) |
| Get the path for the given string if it exists, or create it if it does not. | |
| void | oxr_path_store_only_get (const struct oxr_path_store *store, const char *str, size_t length, XrPath *out_path) |
| Only get the path for the given string if it exists. | |
| XrResult | oxr_path_store_get_string (const struct oxr_path_store *store, XrPath path, const char **out_str, size_t *out_length) |
| Get a pointer and length of the internal string. | |
Data Fields | |
| struct u_hashset * | path_store |
| Path store, for looking up paths. | |
| struct oxr_path ** | path_array |
| Mapping from ID to path. | |
| size_t | path_array_length |
| Total length of path array. | |
| size_t | path_num |
| Number of paths in the array (0 is always null). | |
Path store structure for managing path storage and lookup.
| void oxr_path_store_fini | ( | struct oxr_path_store * | store | ) |
Destroy the path store and all paths.
References path_array, path_array_length, path_num, path_store, and u_hashset_clear_and_call_for_each().
| XrResult oxr_path_store_get_or_create | ( | struct oxr_path_store * | store, |
| const char * | str, | ||
| size_t | length, | ||
| XrPath * | out_path | ||
| ) |
Get the path for the given string if it exists, or create it if it does not.
References path_store.
| XrResult oxr_path_store_get_string | ( | const struct oxr_path_store * | store, |
| XrPath | path, | ||
| const char ** | out_str, | ||
| size_t * | out_length | ||
| ) |
Get a pointer and length of the internal string.
The pointer has the same life time as the store. The length is the number of valid characters, not including the null termination character (but an extra null byte is always reserved at the end so can strings can be given to functions expecting null terminated strings).
| XrResult oxr_path_store_init | ( | struct oxr_path_store * | store | ) |
Initialize the path store.
References path_array, path_array_length, path_num, path_store, and U_ARRAY_REALLOC_OR_FREE.
| bool oxr_path_store_is_valid | ( | struct oxr_logger * | log, |
| const struct oxr_path_store * | store, | ||
| XrPath | xr_path | ||
| ) |
Check if a path ID is valid.
| void oxr_path_store_only_get | ( | const struct oxr_path_store * | store, |
| const char * | str, | ||
| size_t | length, | ||
| XrPath * | out_path | ||
| ) |
Only get the path for the given string if it exists.
References path_store.
| struct oxr_path** oxr_path_store::path_array |
Mapping from ID to path.
Referenced by oxr_path_store_fini(), and oxr_path_store_init().
| size_t oxr_path_store::path_array_length |
Total length of path array.
Referenced by oxr_path_store_fini(), and oxr_path_store_init().
| size_t oxr_path_store::path_num |
Number of paths in the array (0 is always null).
Referenced by oxr_path_store_fini(), and oxr_path_store_init().
| struct u_hashset* oxr_path_store::path_store |
Path store, for looking up paths.
Referenced by oxr_path_store_fini(), oxr_path_store_get_or_create(), oxr_path_store_init(), and oxr_path_store_only_get().