summaryrefslogtreecommitdiffstats
path: root/gfx/vr/service/openvr/src/vrpathregistry_public.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /gfx/vr/service/openvr/src/vrpathregistry_public.h
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/vr/service/openvr/src/vrpathregistry_public.h')
-rw-r--r--gfx/vr/service/openvr/src/vrpathregistry_public.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/gfx/vr/service/openvr/src/vrpathregistry_public.h b/gfx/vr/service/openvr/src/vrpathregistry_public.h
new file mode 100644
index 0000000000..776935a011
--- /dev/null
+++ b/gfx/vr/service/openvr/src/vrpathregistry_public.h
@@ -0,0 +1,45 @@
+//========= Copyright Valve Corporation ============//
+#pragma once
+
+#include <string>
+#include <vector>
+#include <stdint.h>
+
+static const char *k_pchRuntimeOverrideVar = "VR_OVERRIDE";
+static const char *k_pchConfigOverrideVar = "VR_CONFIG_PATH";
+static const char *k_pchLogOverrideVar = "VR_LOG_PATH";
+
+class CVRPathRegistry_Public
+{
+public:
+ static std::string GetVRPathRegistryFilename();
+ static std::string GetOpenVRConfigPath();
+
+public:
+ CVRPathRegistry_Public();
+
+ /** Returns paths using the path registry and the provided override values. Pass NULL for any paths you don't care about.
+ * Returns false if the path registry could not be read. Valid paths might still be returned based on environment variables. */
+ static bool GetPaths( std::string *psRuntimePath, std::string *psConfigPath, std::string *psLogPath, const char *pchConfigPathOverride, const char *pchLogPathOverride, std::vector<std::string> *pvecExternalDrivers = NULL );
+
+ bool BLoadFromFile( std::string *psError = nullptr );
+ bool BSaveToFile() const;
+
+ bool ToJsonString( std::string &sJsonString );
+
+ // methods to get the current values
+ std::string GetRuntimePath() const;
+ std::string GetConfigPath() const;
+ std::string GetLogPath() const;
+
+protected:
+ typedef std::vector< std::string > StringVector_t;
+
+ // index 0 is the current setting
+ StringVector_t m_vecRuntimePath;
+ StringVector_t m_vecLogPath;
+ StringVector_t m_vecConfigPath;
+
+ // full list of external drivers
+ StringVector_t m_vecExternalDrivers;
+};