void append_flags (const std::string& flags, const std::string& arch, const std::string& path, flag_type type) { std::string* oflags; switch (type) { case ft_cppflags: oflags = &cppflags; break; case ft_cflags: oflags = &cflags; break; case ft_cxxflags: oflags = &cxxflags; break; case ft_ldflags: oflags = &ldflags; break; default: throw rld::error ("Invalid flag type", "CC set flags"); } if (oflags->empty ()) *oflags += filter_flags (flags, arch, path, type); else *oflags += ' ' + filter_flags (flags, arch, path, type); }
const std::string filter_flags (const std::string& flags, const std::string& arch, const std::string& path, flag_type type) { if (type != ft_cflags) { std::string warnings; std::string includes; std::string machines; std::string specs; return filter_flags (flags, arch, path, type, warnings, includes, machines, specs); } else { return filter_flags (flags, arch, path, type, warning_cflags, include_cflags, machine_cflags, spec_cflags); } }
void set_flags (const std::string& flags, const std::string& arch, const std::string& path, flag_type type) { std::string* oflags; switch (type) { case ft_cppflags: oflags = &cppflags; break; case ft_cflags: oflags = &cflags; break; case ft_cxxflags: oflags = &cxxflags; break; case ft_ldflags: oflags = &ldflags; break; default: throw rld::error ("Invalid flag type", "CC set flags"); } (*oflags) = filter_flags (flags, arch, path, type); }
void monitor::notify_events(const std::vector<event>& events) const { FSW_MONITOR_NOTIFY_GUARD; // Update the last notification timestamp #ifdef HAVE_INACTIVITY_CALLBACK milliseconds now = duration_cast<milliseconds>( system_clock::now().time_since_epoch()); last_notification.store(now); #endif std::vector<event> filtered_events; for (auto const& event : events) { // Filter flags std::vector<fsw_event_flag> filtered_flags = filter_flags(event); if (filtered_flags.empty()) continue; if (!accept_path(event.get_path())) continue; filtered_events.emplace_back(event.get_path(), event.get_time(), filtered_flags); } if (!filtered_events.empty()) { FSW_ELOG(string_utils::string_from_format(_("Notifying events #: %d.\n"), filtered_events.size()).c_str()); callback(filtered_events, context); } }