MCPcopy Create free account
hub / github.com/CobaltFusion/DebugViewPP / GetTextColor

Method GetTextColor

DebugView++/LogView.cpp:1785–1814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1783}
1784
1785TextColor CLogView::GetTextColor(const Message& msg) const
1786{
1787 auto messageFilters = MoveHighlighFiltersToFront(m_filter.messageFilters);
1788 for (auto& filter : messageFilters)
1789 {
1790 std::smatch match;
1791 if (filter.enable && FilterSupportsColor(filter.filterType) && std::regex_search(msg.text, match, filter.re))
1792 {
1793 if (filter.bgColor == Colors::Auto)
1794 {
1795 auto it = m_matchColors.find(MatchKey(match, filter.matchType));
1796 if (it != m_matchColors.end())
1797 return TextColor(it->second, Colors::Text);
1798 }
1799 else
1800 {
1801 return TextColor(filter.bgColor, filter.fgColor);
1802 }
1803 }
1804 }
1805
1806 auto processFilters = MoveHighlighFiltersToFront(m_filter.processFilters);
1807 for (auto& filter : processFilters)
1808 {
1809 if (filter.enable && FilterSupportsColor(filter.filterType) && std::regex_search(msg.processName, filter.re))
1810 return TextColor(filter.bgColor, filter.fgColor);
1811 }
1812
1813 return TextColor(m_processColors ? msg.color : Colors::BackGround, Colors::Text);
1814}
1815
1816bool CLogView::IsClearMessage(const Message& msg) const
1817{

Callers

nothing calls this directly

Calls 4

FilterSupportsColorFunction · 0.85
MatchKeyFunction · 0.85
TextColorClass · 0.85

Tested by

no test coverage detected