Monado OpenXR Runtime
Loading...
Searching...
No Matches
u_str_to_enum.h
Go to the documentation of this file.
1// Copyright 2026, NVIDIA CORPORATION.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief String to enum conversion for XRT enums.
6 * @author Jakob Bornecrantz <tbornecrantz@nvidia.com>
7 * @ingroup aux_util
8 */
9
10#pragma once
11
12#include "xrt/xrt_defines.h"
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18/*!
19 * Parse an @ref xrt_input_name from its string representation.
20 *
21 * @return true if @p str was recognized and @p out_name was set.
22 *
23 * @ingroup aux_util
24 */
25bool
26u_str_to_xrt_input_name(const char *str, enum xrt_input_name *out_name);
27
28/*!
29 * Parse an @ref xrt_output_name from its string representation.
30 *
31 * @return true if @p str was recognized and @p out_name was set.
32 *
33 * @ingroup aux_util
34 */
35bool
36u_str_to_xrt_output_name(const char *str, enum xrt_output_name *out_name);
37
38/*!
39 * Parse an @ref xrt_input_name from its string representation.
40 *
41 * Returns @ref XRT_INPUT_GENERIC_TRACKER_POSE if @p str is not recognized.
42 *
43 * @ingroup aux_util
44 */
47
48/*!
49 * Parse an @ref xrt_output_name from its string representation.
50 *
51 * Returns @ref XRT_OUTPUT_NAME_SIMPLE_VIBRATION if @p str is not recognized.
52 *
53 * @ingroup aux_util
54 */
57
58#ifdef __cplusplus
59}
60#endif
bool u_str_to_xrt_input_name(const char *str, enum xrt_input_name *out_name)
Parse an xrt_input_name from its string representation.
Definition u_str_to_enum.c:45
enum xrt_input_name u_str_to_xrt_input_name_or_default(const char *str)
Parse an xrt_input_name from its string representation.
Definition u_str_to_enum.c:61
enum xrt_output_name u_str_to_xrt_output_name_or_default(const char *str)
Parse an xrt_output_name from its string representation.
Definition u_str_to_enum.c:73
bool u_str_to_xrt_output_name(const char *str, enum xrt_output_name *out_name)
Parse an xrt_output_name from its string representation.
Definition u_str_to_enum.c:53
xrt_input_name
Every internal input source known to monado with a baked in type.
Definition xrt_defines.h:930
xrt_output_name
Name of a output with a baked in type.
Definition xrt_defines.h:1612
Common defines and enums for XRT.