Lines Matching refs:pos

530   size_t pos = 0;  in isBluntRebootReason()  local
531 while ((pos = r.find(',', pos)) != std::string::npos) { in isBluntRebootReason()
532 ++pos; in isBluntRebootReason()
533 std::string next(r.substr(pos)); in isBluntRebootReason()
570 size_t numError(size_t pos, const std::string& _r) const { in numError() argument
571 const char* l = console.c_str() + pos; in numError()
600 size_t pos = console.rfind(needle); // exact match? in rfind() local
601 if (pos != std::string::npos) return pos; in rfind()
604 pos = console.length(); in rfind()
605 if (needle.length() > pos) return std::string::npos; in rfind()
606 pos -= needle.length(); in rfind()
609 if (numError(pos, needle) != std::string::npos) return pos; in rfind()
610 if (pos == 0) break; in rfind()
611 --pos; in rfind()
622 for (size_t pos = start; pos <= last_pos; ++pos) { in find() local
623 if (numError(pos, needle) != std::string::npos) return pos; in find()
638 for (size_t pos = 0; pos <= last_pos; pos += needle.length()) { in correctForBitError() local
639 pos = console.find(needle, pos); in correctForBitError()
640 if (pos == std::string::npos) break; in correctForBitError()
643 if (needle == reason.substr(pos, needle.length())) continue; in correctForBitError()
646 reason = reason.substr(0, pos) + needle + reason.substr(pos + needle.length()); in correctForBitError()
768 std::string getSubreason(const std::string& content, size_t pos, bool quoted) { in getSubreason() argument
771 std::string subReason(content.substr(pos, max_reason_length)); in getSubreason()
790 for (pos = 0; pos < subReason.length(); ++pos) { in getSubreason()
791 char c = subReason[pos]; in getSubreason()
794 subReason.erase(pos); in getSubreason()
810 auto pos = console.rfind(sysrqSubreason); in addKernelPanicSubReason() local
811 if (pos != std::string::npos) { in addKernelPanicSubReason()
812 ret += "," + getSubreason(console, pos + strlen(sysrqSubreason), /* quoted */ true); in addKernelPanicSubReason()
827 auto pos = console.rfind(panic); in addKernelPanicSubReason() local
828 if (pos != std::string::npos) { in addKernelPanicSubReason()
855 if (console.find(panic + s.first, pos) != std::string::npos) { in addKernelPanicSubReason()
860 auto reason = getSubreason(console, pos + panic.length(), /* newline */ false); in addKernelPanicSubReason()
1032 size_t pos = console.rfind(cmd); in BootReasonStrToReason() local
1033 if (pos != std::string::npos) { in BootReasonStrToReason()
1034 std::string subReason(getSubreason(content, pos + strlen(cmd), /* quoted */ true)); in BootReasonStrToReason()