Upload Source/Plugin/Blocklist.h
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768#pragma once
#include <juce_core/juce_core.h>#include <set>
// Simple persistent blocklist — stores plugin paths that crashed on load.// Saved to ~/Library/Application Support/PluginBridge/blocklist.txt
class Blocklist{public: Blocklist() { load(); }
bool isBlocked(const juce::String& path) const { return blockedPaths.count(path.toStdString()) > 0; }
void addBlocked(const juce::String& path) { blockedPaths.insert(path.toStdString()); save(); }
void clear() { blockedPaths.clear(); save(); }
private: std::set<std::string> blockedPaths;
juce::File getBlocklistFile() const { auto dir = juce::File::getSpecialLocation(juce::File::userApplicationDataDirectory) .getChildFile("PluginBridge"); dir.createDirectory(); return dir.getChildFile("blocklist.txt"); }
void load() { auto file = getBlocklistFile(); if (!file.existsAsFile()) return;
juce::StringArray lines; file.readLines(lines); for (auto& line : lines) { auto trimmed = line.trim(); if (trimmed.isNotEmpty()) blockedPaths.insert(trimmed.toStdString()); } }
void save() { auto file = getBlocklistFile(); juce::String content; for (auto& path : blockedPaths) content += juce::String(path) + "\n"; file.replaceWithText(content); }};Source/Plugin/Blocklist.hAdded+68