#ifdef NALL_STRING_INTERNAL_HPP namespace nall { template auto _split(lstring& self, rstring source, rstring find) -> lstring& { self.reset(); if(find.size() == 0) return self; const char* p = source.data(); signed size = source.size(); signed base = 0; signed matches = 0; for(signed n = 0, quoted = 0; n <= size - (signed)find.size();) { if(Quoted) { if(p[n] == '\"') { quoted ^= 1; n++; continue; } if(quoted) { n++; continue; } } if(_compare(p + n, size - n, find.data(), find.size())) { n++; continue; } if(matches >= Limit) break; string& s = self(matches); s.resize(n - base); memory::copy(s.pointer(), p + base, n - base); n += find.size(); base = n; matches++; } string& s = self(matches); s.resize(size - base); memory::copy(s.pointer(), p + base, size - base); return self; } template auto split(string& self, rstring on) -> lstring { return lstring().split(self, on); } template auto isplit(string& self, rstring on) -> lstring { return lstring().isplit(self, on); } template auto qsplit(string& self, rstring on) -> lstring { return lstring().qsplit(self, on); } template auto iqsplit(string& self, rstring on) -> lstring { return lstring().iqsplit(self, on); } template auto string::split(rstring on) const -> lstring { return lstring().split(*this, on); } template auto string::isplit(rstring on) const -> lstring { return lstring().isplit(*this, on); } template auto string::qsplit(rstring on) const -> lstring { return lstring().qsplit(*this, on); } template auto string::iqsplit(rstring on) const -> lstring { return lstring().iqsplit(*this, on); } } #endif