mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-16 08:24:05 +02:00
Update to v098r10 release.
byuu says: Changelog: - synchronized tomoko, loki, icarus with extensive changes to nall (118KiB diff)
This commit is contained in:
@@ -3,16 +3,16 @@
|
||||
namespace nall {
|
||||
|
||||
template<bool Insensitive, bool Quoted>
|
||||
auto lstring::_split(rstring source, rstring find, long limit) -> lstring& {
|
||||
auto lstring::_split(string_view source, string_view find, long limit) -> lstring& {
|
||||
reset();
|
||||
if(limit <= 0 || find.size() == 0) return *this;
|
||||
|
||||
const char* p = source.data();
|
||||
signed size = source.size();
|
||||
signed base = 0;
|
||||
signed matches = 0;
|
||||
int size = source.size();
|
||||
int base = 0;
|
||||
int matches = 0;
|
||||
|
||||
for(signed n = 0, quoted = 0; n <= size - (signed)find.size();) {
|
||||
for(int n = 0, quoted = 0; n <= size - (int)find.size();) {
|
||||
if(Quoted) { if(p[n] == '\"') { quoted ^= 1; n++; continue; } if(quoted) { n++; continue; } }
|
||||
if(string::_compare<Insensitive>(p + n, size - n, find.data(), find.size())) { n++; continue; }
|
||||
if(matches >= limit) break;
|
||||
@@ -33,9 +33,9 @@ auto lstring::_split(rstring source, rstring find, long limit) -> lstring& {
|
||||
return *this;
|
||||
}
|
||||
|
||||
auto string::split(rstring on, long limit) const -> lstring { return lstring()._split<0, 0>(*this, on, limit); }
|
||||
auto string::isplit(rstring on, long limit) const -> lstring { return lstring()._split<1, 0>(*this, on, limit); }
|
||||
auto string::qsplit(rstring on, long limit) const -> lstring { return lstring()._split<0, 1>(*this, on, limit); }
|
||||
auto string::iqsplit(rstring on, long limit) const -> lstring { return lstring()._split<1, 1>(*this, on, limit); }
|
||||
auto string::split(string_view on, long limit) const -> lstring { return lstring()._split<0, 0>(*this, on, limit); }
|
||||
auto string::isplit(string_view on, long limit) const -> lstring { return lstring()._split<1, 0>(*this, on, limit); }
|
||||
auto string::qsplit(string_view on, long limit) const -> lstring { return lstring()._split<0, 1>(*this, on, limit); }
|
||||
auto string::iqsplit(string_view on, long limit) const -> lstring { return lstring()._split<1, 1>(*this, on, limit); }
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user