1 //===-- LogFilterChain.h ----------------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLDB_TOOLS_DEBUGSERVER_SOURCE_MACOSX_DARWINLOG_LOGFILTERCHAIN_H 10 #define LLDB_TOOLS_DEBUGSERVER_SOURCE_MACOSX_DARWINLOG_LOGFILTERCHAIN_H 11 12 #include <vector> 13 14 #include "DarwinLogInterfaces.h" 15 16 class LogFilterChain { 17 public: 18 LogFilterChain(bool default_accept); 19 20 void AppendFilter(const LogFilterSP &filter_sp); 21 22 void ClearFilterChain(); 23 24 bool GetDefaultAccepts() const; 25 26 void SetDefaultAccepts(bool default_accepts); 27 28 bool GetAcceptMessage(const LogMessage &message) const; 29 30 private: 31 using FilterVector = std::vector<LogFilterSP>; 32 33 FilterVector m_filters; 34 bool m_default_accept; 35 }; 36 37 #endif // LLDB_TOOLS_DEBUGSERVER_SOURCE_MACOSX_DARWINLOG_LOGFILTERCHAIN_H 38