| 845 | |
| 846 | template<typename HighlightRed,typename ListComplete> |
| 847 | static command_result applyFilterIds(color_ostream& out, |
| 848 | std::vector<std::string>& parameters, |
| 849 | const char* name, |
| 850 | HighlightRed hlRed, |
| 851 | ListComplete listComplete) |
| 852 | { |
| 853 | if (1u >= parameters.size()) { |
| 854 | ERR(command,out) << name << " requires at least a filter id" << std::endl; |
| 855 | return CR_WRONG_USAGE; |
| 856 | } |
| 857 | command_result rv = CR_OK; |
| 858 | { |
| 859 | auto& catMan = DebugManager::getInstance(); |
| 860 | std::lock_guard<std::mutex> lock(catMan.access_mutex_); |
| 861 | auto& filMan = FilterManager::getInstance(); |
| 862 | unsigned line = 0; |
| 863 | for (size_t pos = 1; pos < parameters.size(); ++pos) { |
| 864 | const std::string& p = parameters[pos]; |
| 865 | auto iter = parseFilterId(out, p); |
| 866 | if (iter == filMan.end()) |
| 867 | continue; |
| 868 | color_value c = (line & 1) == 0 ? COLOR_CYAN : COLOR_LIGHTCYAN; |
| 869 | if (hlRed(iter)) |
| 870 | c = COLOR_RED; |
| 871 | printFilterListEntry(out,line++,c,iter->first,iter->second); |
| 872 | } |
| 873 | rv = listComplete(); |
| 874 | } |
| 875 | out.color(COLOR_RESET); |
| 876 | out.flush(); |
| 877 | return rv; |
| 878 | } |
| 879 | |
| 880 | //! Handler for debugfilter disable |
| 881 | static command_result disableFilter(color_ostream& out, |
no test coverage detected