• Home
  • Raw
  • Download

Lines Matching refs:needle

465   size_t rfind(const std::string& needle) const {  in rfind()
466 size_t pos = console.rfind(needle); // exact match? in rfind()
471 if (needle.length() > pos) return std::string::npos; in rfind()
472 pos -= needle.length(); in rfind()
475 if (numError(pos, needle) != std::string::npos) return pos; in rfind()
483 size_t find(const std::string& needle, size_t start = 0) const { in find() argument
485 if (needle.length() > console.length()) return std::string::npos; in find()
486 const size_t last_pos = console.length() - needle.length(); in find()
489 if (numError(pos, needle) != std::string::npos) return pos; in find()
499 bool correctForBitError(std::string& reason, const std::string& needle) { in correctForBitError() argument
501 if (reason.length() < needle.length()) return corrected; in correctForBitError()
503 const size_t last_pos = reason.length() - needle.length(); in correctForBitError()
504 for (size_t pos = 0; pos <= last_pos; pos += needle.length()) { in correctForBitError()
505 pos = console.find(needle, pos); in correctForBitError()
509 if (needle == reason.substr(pos, needle.length())) continue; in correctForBitError()
512 reason = reason.substr(0, pos) + needle + reason.substr(pos + needle.length()); in correctForBitError()
520 bool correctForBitErrorOrUnderline(std::string& reason, const std::string& needle) { in correctForBitErrorOrUnderline() argument
521 bool corrected = correctForBitError(reason, needle); in correctForBitErrorOrUnderline()
522 std::string _needle(needle); in correctForBitErrorOrUnderline()
525 if (needle != _needle) { in correctForBitErrorOrUnderline()