summaryrefslogtreecommitdiff
path: root/Source/Core/Common/StringUtil.h
AgeCommit message (Collapse)Author
2026-02-21MagneticCardReader: Minor fixup to writing card data.Jordan Woyak
Ensure the 3rd track is written even if the 2nd track isn't. Moved GetHexDump helper function to StringUtil.
2026-02-15StringUtil: Add SplitStringIntoArray function template.Jordan Woyak
2026-01-17Merge pull request #14289 from Sintendo/typosJMC47
Fix various typos and spelling mistakes
2026-01-17Fix various typos and spelling mistakesSintendo
2026-01-09c++23: Replace Common::ToUnderlying with std::to_underlyingJoshua Vandaële
Requires at least GCC 11, Clang 13, MSVC 19.30 (VS2022 17.0), or AppleClang 13.1.6 (XCode 13.3).
2025-12-15StringUtils: Drop TabsToSpacesSintendo
This function is unused.
2025-11-02StringUtil: Fix many clang-tidy warnings.Jordan Woyak
2025-08-04Qt: Better wayland detection to enforce xcbJoshua Vandaële
In certain cases, the platform can be "wayland-egl", "wayland-xcomposite", and other values for which I haven't found a full list yet. Instead of matching only "wayland", we now look for "wayland" anywhere in the `QT_QPA_PLATFORM` string in a case-insensitive manner. Acknowledgements: `CaseInsensitiveContains`' implementation was heavily inspired by GNU's non-standard glibc `strcasestr` function, which can be found here licensed under GPLv2 or later: https://ftp.gnu.org/gnu/libc/
2025-05-01StringUtil: Use concepts instead of enable_if.Jordan Woyak
2025-04-23 linter: Add and apply new formatting rulesJoshua Vandaële
New rules: `InsertNewlineAtEOF: true` `RemoveSemicolon: true` `RequiresClausePosition: WithPreceding`
2025-04-23linter: Apply clang-format 19.1 formattingJoshua Vandaële
find ./Source/ -name '*.cpp' -o -name '*.h' | xargs clang-format-19 -i
2024-12-15StringUtil: More Wrappers For <cctype>mitaclaw
`Common::IsLower(char)` was omitted as nothing needed it.
2024-09-26Merge pull request #13068 from mitaclaw/redundant-case-insensitiveJMC47
IniFile: Migrate `Common::CaseInsensitiveLess` to StringUtil
2024-09-22StringUtil: Remove `JoinStrings`mitaclaw
With 12 uses of `JoinStrings` in the codebase vs 36 uses of `fmt::join`, fmtlib's range adapter for string concatenation with delimiters is clearly the preferred option.
2024-09-21IniFile: Migrate `Common::CaseInsensitiveLess` to StringUtilmitaclaw
Migrating `Common::CaseInsensitiveLess` to StringUtil.h will hopefully discourage rolling one's own solution in the future for case-insensitive associative containers when this (quite robust!) solution already exists. `Common::CaseInsensitiveStringCompare::IsEqual` was removed in favor of using the `Common::CaseInsensitiveEquals` function. The `a.size() != b.size()` condition in `Common::CaseInsensitiveEquals` can be removed, since `std::ranges::equal` already checks this condition (confirmed in libc++).
2024-08-20Remove redundant semicolonsDr. Dystopia
2023-09-03IOS/KD: Implement NWC24_CHECK_MAIL_NOWSketch
2023-06-26Merge pull request #11903 from noahpistilli/wiilinkAdmiral H. Curtiss
IOS/KD: Add WiiLink as WC24 service provider by default
2023-06-25Add default support for WiiLink + configurationSketch
2023-06-22Kill AsciiToHexget
Now superseded by Common::FromChars
2023-05-16StringUtil: Move ThousandSeparate() into Common namespaceLioncash
2023-05-16StringUtil: Move CommandLineToUtf8Argv() into Common namespaceLioncash
2023-05-16StringUtil: Move GetEscapedHtml() into Common namespaceLioncash
2023-05-16StringUtil: Move IsPrintableCharacter() into Common namespaceLioncash
2023-05-16StringUtil: Move IsAlpha() into Common namespaceLioncash
2023-02-28Common: Add utility function for case-insensitive string comparison.Admiral H. Curtiss
2023-01-24StringUtil: Make StringUTF8CodePointCount take string_viewLioncash
There's nothing really about this that would need to constrain it to only std::string instances.
2023-01-24Common: Replace StringBeginsWith/StringEndsWith with std equivalentsLioncash
Obsoletes these functions in favor of the standard member functions added in C++20.
2023-01-10get rid of HAS_STD_FILESYSTEMShawn Hoffman
just use std::filesystem
2022-07-26Merge pull request #10876 from shuffle2/cpudetectAdmiral H. Curtiss
CPUDetect: improve win/arm64 support
2022-07-25CPUDetect: improve win/arm64 supportShawn Hoffman
read brand_string on macos/arm64 remove unused flags report family/model info instead of vendor name
2022-07-25StripSpaces: only strip spacesShawn Hoffman
StripWhitespace maintains old behavior
2022-06-05Common/StringUtil: Add convenience function for converting paths to use ↵Admiral H. Curtiss
forward slashes on Windows.
2022-03-06Move parts of MappingCommon out of DolphinQtJosJuice
Some of the functions in MappingCommon would be useful to use on mobile in the future.
2022-01-16Create Common::ToLower and Common::ToUpperPokechu22
2021-07-21StringUtil: Remove unused function BuildCompleteFilenameDentomologist
2021-07-05treewide: convert GPLv2+ license info to SPDX tagsPierre Bourdon
SPDX standardizes how source code conveys its copyright and licensing information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX tags are adopted in many large projects, including things like the Linux kernel.
2021-06-01Updater: Escape HTML characters in commit descriptionsDentomologist
2021-05-12InputCommon: fix serialization of control expression with line breaksFiloppi
The control expression editor allows line breaks, but the serialization was losing anything after the first line break (/r /n). Instead of opting to encode them and decode them on serialization (which I tried but was not safe, as it would lose /n written in the string by users), I opted to replace them with a space.
2020-09-21DolphinQt: Handle non-ASCII characters in Windows cmd argumentsJosJuice
CommandLineParse expects UTF-8 strings. (QApplication, on the other hand, seems to be designed so that you can pass in the char** argv untouched on Windows and get proper Unicode handling.)
2020-07-18Merge pull request #8905 from JosJuice/jni-encodingLC
Android: Use correct encoding when converting strings
2020-07-16NetPlay: Limit nickname lengthTechjar
Ridiculously long nicknames cause UI silliness, so 30 characters seems like a reasonable limit, as it's the same as the forum.
2020-07-08Android: Use correct encoding when converting stringsJosJuice
The functions with "UTF" in the name use "modified UTF-8" rather than the standard UTF-8 which Dolphin uses, at least according to Oracle's documentation, so it is incorrect for us to use them. This change fixes the problem by converting between UTF-8 and UTF-16 manually instead of letting JNI do it for us.
2020-07-08Common: Rename UTF16ToUTF8JosJuice
This function does *not* always convert from UTF-16. It converts from UTF-16 on Windows and UTF-32 on other operating systems. Also renaming UTF8ToUTF16 for consistency, even though it technically doesn't have the same problem since it only was implemented on Windows.
2020-05-23Common / Core: Update StringUtil to allow specifying the base, default to 0. ↵iwubcode
Fix ActionReplay code to use this instead of prepending '0x' in front
2020-03-16StringUtil: Add PathToFileName functionJosJuice
2020-03-05Source/Core/Common/StringUtil.h: include <limits> for std::numeric_limitsSergei Trofimovich
Without included header build fails on gcc-10 as: ``` [ 13%] Building CXX object Source/Core/AudioCommon/CMakeFiles/audiocommon.dir/CubebUtils.cpp.o In file included from ../../../../Source/Core/AudioCommon/CubebUtils.cpp:13: ../../../../Source/Core/Common/StringUtil.h: In function 'bool TryParse(const string&, T*)': ../../../../Source/Core/Common/StringUtil.h:84:20: error: 'numeric_limits' is not a member of 'std' 84 | if (value < std::numeric_limits<LimitsType>::min() || | ^~~~~~~~~~~~~~ ``` Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2020-01-16StringUtil: Add IsPrintableCharacter and use itLéo Lam
Add a function that safely returns whether a character is printable i.e. whether 0x20 <= c <= 0x7e is true. This is done in several places in our codebase and it's easy to run into undefined behaviour if the C version defined in <cctype> is used instead of this one, since its behaviour is undefined if the character is not representable as an unsigned char. This fixes MemoryViewWidget.
2020-01-04StringUtil: Make TryParse of floats handle comma and dot decimal separators.Jordan Woyak
2019-10-18StringUtil: Require TryParse of float types to use the entire string.Jordan Woyak