diff options
| author | 2024-02-23 11:34:21 -0500 | |
|---|---|---|
| committer | 2024-02-23 11:34:21 -0500 | |
| commit | 215e887be088ed572da999e9ec7fd8559198524b (patch) | |
| tree | 793415b72d36bb07d0174dfcf731f81235008936 /src/common | |
| parent | Merge pull request #13073 from FearlessTobi/fsp-srv-ipc (diff) | |
| parent | oboe_sink: handle temporary stream creation failure (diff) | |
| download | yuzu-215e887be088ed572da999e9ec7fd8559198524b.tar.gz yuzu-215e887be088ed572da999e9ec7fd8559198524b.tar.xz yuzu-215e887be088ed572da999e9ec7fd8559198524b.zip | |
Merge pull request #13100 from liamwhite/audio-ipc
audio: move to new ipc
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/string_util.cpp | 4 | ||||
| -rw-r--r-- | src/common/string_util.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index 72c481798..1909aced5 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp | |||
| @@ -38,6 +38,10 @@ std::string StringFromBuffer(std::span<const u8> data) { | |||
| 38 | return std::string(data.begin(), std::find(data.begin(), data.end(), '\0')); | 38 | return std::string(data.begin(), std::find(data.begin(), data.end(), '\0')); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | std::string StringFromBuffer(std::span<const char> data) { | ||
| 42 | return std::string(data.begin(), std::find(data.begin(), data.end(), '\0')); | ||
| 43 | } | ||
| 44 | |||
| 41 | // Turns " hej " into "hej". Also handles tabs. | 45 | // Turns " hej " into "hej". Also handles tabs. |
| 42 | std::string StripSpaces(const std::string& str) { | 46 | std::string StripSpaces(const std::string& str) { |
| 43 | const std::size_t s = str.find_first_not_of(" \t\r\n"); | 47 | const std::size_t s = str.find_first_not_of(" \t\r\n"); |
diff --git a/src/common/string_util.h b/src/common/string_util.h index 9da1ca4e9..53d0549ca 100644 --- a/src/common/string_util.h +++ b/src/common/string_util.h | |||
| @@ -19,6 +19,7 @@ namespace Common { | |||
| 19 | [[nodiscard]] std::string ToUpper(std::string str); | 19 | [[nodiscard]] std::string ToUpper(std::string str); |
| 20 | 20 | ||
| 21 | [[nodiscard]] std::string StringFromBuffer(std::span<const u8> data); | 21 | [[nodiscard]] std::string StringFromBuffer(std::span<const u8> data); |
| 22 | [[nodiscard]] std::string StringFromBuffer(std::span<const char> data); | ||
| 22 | 23 | ||
| 23 | [[nodiscard]] std::string StripSpaces(const std::string& s); | 24 | [[nodiscard]] std::string StripSpaces(const std::string& s); |
| 24 | [[nodiscard]] std::string StripQuotes(const std::string& s); | 25 | [[nodiscard]] std::string StripQuotes(const std::string& s); |