| Age | Commit message (Collapse) | Author |
|
values uses a case insensitive comparison, so erasing the equivalent key in keys_order also must do so.
|
|
|
|
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++).
|
|
|
|
Gets this out of the global namespace and into the Common namespace
|
|
StripWhitespace maintains old behavior
|
|
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.
|
|
|
|
|
|
|
|
Now that the std::map less-than comparitor is capable of being used with
heterogenous lookup, we're able to convert many of the querying
functions that took std::string references over to std::string_view.
Now these functions may be used without potentially allocating a
std::string instance unnecessarily.
|
|
lookup
Previously, when performing find() operations or indexing operations on
the section map, it would need to operate on a std::string key.
This means cases like:
map.find(some_string_view)
aren't usable, which kind of sucks, especially given for most cases, we
use regular string literals to perform operations in calling code.
However, since C++14, it's possible to use heterogenous lookup to avoid
needing to construct exact key types. In otherwords, we can perform the
above or use string literals without constructing a std::string instance
around them implicitly.
We simply need to specify a member type within our comparison struct
named is_transparent, to allow std::map to perform automatic type
deduction.
We also slightly alter the algorithm to an equivalent compatible with
std::string_view (which need not be null-terminated), as strcasecmp
requires null-terminated strings.
While we're at it, we can also provide a helper function to the struct
for comparing string equality rather than only less than. This allows
removing other usages of strcasecmp in other functions, allowing for the
transition of them to std::string_view.
|
|
Avoids dragging in IniFile, EXI device and SI device headers in this header which is
quite widely used throughout the codebase.
This also uncovered a few cases where indirect inclusions were being
relied upon, which this also fixes.
|
|
Common/IniFile: Simplify Set()
|
|
While current usages of ParseLine aren't problematic, this is still a
public function that can be used for other purposes. Essentially makes
the function handle potential external inputs a little nicer.
|
|
We can just utilize map's insert_or_assign() function and check the
return value to determine whether or not we need to insert the key into
the keys_order vector.
|
|
|
|
|
|
Gets rid of duplicated code.
|
|
|
|
An identical implementation is used by IniFile, so move those functions
to StringUtil. A future commit will modify IniFile to use them.
|
|
Updated version of #47. Android should support to_string now that
we use a modern version of libc++ when building.
|
|
For consistency with the other functions in FileUtil.h.
|
|
Same thing, more straightforward.
|
|
|
|
Also gets rid of an unnecessary string copy.
|
|
Character overloads are generally better overall (range checks aren't
necessary, etc).
|
|
Allows moving in vectors instead of performing an unnecessary copy.
|
|
As the name is immediately stored into a class member, a move here is a
better choice.
This also moves the constructor implementations into the cpp file to
avoid an otherwise unnecessary inclusion in the header. This is also
likely a better choice as Section contains several non-trivial members,
so this would avoid potentially inlining a bunch of setup and teardown
code related to them as a side-benefit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Actually caused by IniFiles::GetLines leaving the output vector in its
old state if the section wasn't found, and Gecko::LoadCodes not checking
the return value. Fix by moving lines->clear() up.
|
|
|
|
|
|
It's unnecessary to use find_first_of when all you're searching for is a single character.
|
|
|
|
|
|
|
|
This class loads all the common PP shader configuration options and passes those options through to a inherited class that OpenGL or D3D will have.
Makes it so all the common code for PP shaders is in VideoCommon instead of duplicating the code across each backend.
|
|
pointer invalidation with use of GetOrCreateSection.
|
|
|
|
std::getline is the string-based equivalent.
|
|
because the eof was reached.
|
|
Fixes issue 7283.
|
|
|
|
|