32const std::string_view::value_type *
BufferSearch::process(
const std::string_view::value_type *buffer, std::size_t bufferSize)
34 if (m_hasResult || (!m_giveUpTerm.empty() && m_giveUpTermIterator == m_giveUpTerm.end())) {
37 for (
auto i = buffer, end = buffer + bufferSize;
i != end; ++
i) {
38 const auto currentChar = *
i;
39 if (m_searchTermIterator == m_searchTerm.end()) {
40 if (m_terminationChars.empty()) {
43 for (
const auto &terminationChar : m_terminationChars) {
44 if (currentChar == terminationChar) {
52 m_callback(*
this, std::move(m_result));
56 m_result += currentChar;
59 if (currentChar == *m_searchTermIterator) {
60 ++m_searchTermIterator;
62 m_searchTermIterator = m_searchTerm.begin();
64 if (m_giveUpTerm.empty()) {
67 if (currentChar == *m_giveUpTermIterator) {
68 ++m_giveUpTermIterator;
70 m_giveUpTermIterator = m_giveUpTerm.begin();