summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/fs/path_util.cpp6
-rw-r--r--src/common/fs/path_util.h2
-rw-r--r--src/common/settings_enums.h7
3 files changed, 7 insertions, 8 deletions
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp
index d2f50432a..4f69db6f5 100644
--- a/src/common/fs/path_util.cpp
+++ b/src/common/fs/path_util.cpp
@@ -418,9 +418,9 @@ std::string SanitizePath(std::string_view path_, DirectorySeparator directory_se
418 return std::string(RemoveTrailingSlash(path)); 418 return std::string(RemoveTrailingSlash(path));
419} 419}
420 420
421std::string_view GetParentPath(std::string_view path) { 421std::string GetParentPath(std::string_view path) {
422 if (path.empty()) { 422 if (path.empty()) {
423 return path; 423 return std::string(path);
424 } 424 }
425 425
426#ifdef ANDROID 426#ifdef ANDROID
@@ -439,7 +439,7 @@ std::string_view GetParentPath(std::string_view path) {
439 name_index = std::max(name_bck_index, name_fwd_index); 439 name_index = std::max(name_bck_index, name_fwd_index);
440 } 440 }
441 441
442 return path.substr(0, name_index); 442 return std::string(path.substr(0, name_index));
443} 443}
444 444
445std::string_view GetPathWithoutTop(std::string_view path) { 445std::string_view GetPathWithoutTop(std::string_view path) {
diff --git a/src/common/fs/path_util.h b/src/common/fs/path_util.h
index 23c8b1359..59301e7ed 100644
--- a/src/common/fs/path_util.h
+++ b/src/common/fs/path_util.h
@@ -302,7 +302,7 @@ enum class DirectorySeparator {
302 DirectorySeparator directory_separator = DirectorySeparator::ForwardSlash); 302 DirectorySeparator directory_separator = DirectorySeparator::ForwardSlash);
303 303
304// Gets all of the text up to the last '/' or '\' in the path. 304// Gets all of the text up to the last '/' or '\' in the path.
305[[nodiscard]] std::string_view GetParentPath(std::string_view path); 305[[nodiscard]] std::string GetParentPath(std::string_view path);
306 306
307// Gets all of the text after the first '/' or '\' in the path. 307// Gets all of the text after the first '/' or '\' in the path.
308[[nodiscard]] std::string_view GetPathWithoutTop(std::string_view path); 308[[nodiscard]] std::string_view GetPathWithoutTop(std::string_view path);
diff --git a/src/common/settings_enums.h b/src/common/settings_enums.h
index d6351e57e..617036588 100644
--- a/src/common/settings_enums.h
+++ b/src/common/settings_enums.h
@@ -82,16 +82,15 @@ enum class AudioEngine : u32 {
82 Cubeb, 82 Cubeb,
83 Sdl2, 83 Sdl2,
84 Null, 84 Null,
85 Oboe,
85}; 86};
86 87
87template <> 88template <>
88inline std::vector<std::pair<std::string, AudioEngine>> 89inline std::vector<std::pair<std::string, AudioEngine>>
89EnumMetadata<AudioEngine>::Canonicalizations() { 90EnumMetadata<AudioEngine>::Canonicalizations() {
90 return { 91 return {
91 {"auto", AudioEngine::Auto}, 92 {"auto", AudioEngine::Auto}, {"cubeb", AudioEngine::Cubeb}, {"sdl2", AudioEngine::Sdl2},
92 {"cubeb", AudioEngine::Cubeb}, 93 {"null", AudioEngine::Null}, {"oboe", AudioEngine::Oboe},
93 {"sdl2", AudioEngine::Sdl2},
94 {"null", AudioEngine::Null},
95 }; 94 };
96} 95}
97 96