summaryrefslogtreecommitdiff
path: root/Source/Core/Common/StringUtil.h
AgeCommit message (Collapse)Author
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
2019-07-23StringUtil: Comply with variable naming styleJosJuice
2019-07-23StringUtil: Use std::string_view moreJosJuice
2019-06-21Work around C++20 std::filesystem changes related to u8stringJosJuice
2018-06-15PowerPC: Convert CPUCore enum into an enum classLioncash
Makes the enum values strongly-typed and prevents the identifiers from polluting the PowerPC namespace. This also cleans up the parameters of some functions where we were accepting an ambiguous int type and expecting the correct values to be passed in. Now those parameters accept a PowerPC::CPUCore type only, making it immediately obvious which values should be passed in. It also turns out we were storing these core types into other structures as plain ints, which have also been corrected. As this type is used directly with the configuration code, we need to provide our own overloaded insertion (<<) and extraction (>>) operators in order to make it compatible with it. These are fairly trivial to implement, so there's no issue here. A minor adjustment to TryParse() was required, as our generic function was doing the following: N tmp = 0; which is problematic, as custom types may not be able to have that assignment performed (e.g. strongly-typed enums), so we change this to: N tmp; which is sufficient, as the value is attempted to be initialized immediately under that statement.
2018-06-03StringUtil: Remove ValueToString(std::string)Léo Lam
Doesn't make a lot of sense to have a function that gives the string representation for a string.
2018-06-03Move Config ValueToString to StringUtilLéo Lam
An identical implementation is used by IniFile, so move those functions to StringUtil. A future commit will modify IniFile to use them.
2018-05-08StringUtil.h: Move ThousandSeparate downJosJuice
It calls UTF16ToUTF8 on Windows, so it should come after UTF16ToUTF8.
2018-04-09Remove old code for using default localeJosJuice
This isn't needed anymore now that the global C++ locale isn't set to the classic locale.
2018-03-10StringUtil: Fix Windows encoding in ThousandSeparateJosJuice
Some locales use non-breaking spaces as separators, so getting the encoding right is important. If DolphinWX gets a string that isn't valid UTF-8, it flat out won't display the string.
2017-11-03Add WiiSaveBanner classJosJuice
This class is similar to the BannerLoaderWii class that was removed in ee694e32.
2017-09-18StringUtil: support TryParse(u16*)Pierre Bourdon
2017-07-05Replace StringFromInt with std::to_stringLéo Lam
Updated version of #47. Android should support to_string now that we use a modern version of libc++ when building.
2017-06-11StringUtil: Make SplitString return by valueLéo Lam
Simpler usage.
2017-06-06StringUtil: StringPopBackIf addedSepalani
2017-05-01Convert VolumeDirectory names back to SHIFT-JIS (issue #9988)spycrab
2017-02-25IniFile: Handle s64/u64 valuesLioncash