// Small case-insensitive text helpers shared by the host panels' filter boxes, so // "error" matches "ERROR" everywhere consistently. ASCII-fold only (the UI filters // are typed ASCII); non-ASCII bytes compare as-is. #pragma once #include #include namespace coop { inline std::string ascii_lower(std::string s) { for (char& c : s) { c = static_cast(std::tolower(static_cast(c))); } return s; } // True when `needle` is empty or a case-insensitive substring of `haystack`. inline bool contains_ci(const std::string& haystack, const char* needle) { if (needle == nullptr || needle[0] == '\0') { return true; } return ascii_lower(haystack).find(ascii_lower(needle)) != std::string::npos; } } // namespace coop