Lines Matching refs:pos
551 size_t pos = 0; in isBluntRebootReason() local
552 while ((pos = r.find(',', pos)) != std::string::npos) { in isBluntRebootReason()
553 ++pos; in isBluntRebootReason()
554 std::string next(r.substr(pos)); in isBluntRebootReason()
591 size_t numError(size_t pos, const std::string& _r) const { in numError() argument
592 const char* l = console.c_str() + pos; in numError()
621 size_t pos = console.rfind(needle); // exact match? in rfind() local
622 if (pos != std::string::npos) return pos; in rfind()
625 pos = console.length(); in rfind()
626 if (needle.length() > pos) return std::string::npos; in rfind()
627 pos -= needle.length(); in rfind()
630 if (numError(pos, needle) != std::string::npos) return pos; in rfind()
631 if (pos == 0) break; in rfind()
632 --pos; in rfind()
643 for (size_t pos = start; pos <= last_pos; ++pos) { in find() local
644 if (numError(pos, needle) != std::string::npos) return pos; in find()
659 for (size_t pos = 0; pos <= last_pos; pos += needle.length()) { in correctForBitError() local
660 pos = console.find(needle, pos); in correctForBitError()
661 if (pos == std::string::npos) break; in correctForBitError()
664 if (needle == reason.substr(pos, needle.length())) continue; in correctForBitError()
667 reason = reason.substr(0, pos) + needle + reason.substr(pos + needle.length()); in correctForBitError()
789 std::string getSubreason(const std::string& content, size_t pos, bool quoted) { in getSubreason() argument
792 std::string subReason(content.substr(pos, max_reason_length)); in getSubreason()
811 for (pos = 0; pos < subReason.length(); ++pos) { in getSubreason()
812 char c = subReason[pos]; in getSubreason()
815 subReason.erase(pos); in getSubreason()
831 auto pos = console.rfind(sysrqSubreason); in addKernelPanicSubReason() local
832 if (pos != std::string::npos) { in addKernelPanicSubReason()
833 ret += "," + getSubreason(console, pos + strlen(sysrqSubreason), /* quoted */ true); in addKernelPanicSubReason()
848 auto pos = console.rfind(panic); in addKernelPanicSubReason() local
849 if (pos != std::string::npos) { in addKernelPanicSubReason()
876 if (console.find(panic + s.first, pos) != std::string::npos) { in addKernelPanicSubReason()
881 auto reason = getSubreason(console, pos + panic.length(), /* newline */ false); in addKernelPanicSubReason()
1053 size_t pos = console.rfind(cmd); in BootReasonStrToReason() local
1054 if (pos != std::string::npos) { in BootReasonStrToReason()
1055 std::string subReason(getSubreason(content, pos + strlen(cmd), /* quoted */ true)); in BootReasonStrToReason()