#pragma once #include "include/dataStore/ProxyEntity.hpp" #include "include/sys/Process.hpp" namespace Configs { class ExtraCoreData { public: QString path; QString args; QString config; QString configDir; bool noLog; }; class BuildConfigResult { public: QString error; QJsonObject coreConfig; std::shared_ptr extraCoreData; QList> outboundStats; // all, but not including "bypass" "block" }; class BuildTestConfigResult { public: QString error; QMap fullConfigs; QMap tag2entID; QJsonObject coreConfig; QStringList outboundTags; }; class BuildConfigStatus { public: std::shared_ptr result; std::shared_ptr ent; int chainID = 0; bool forTest; bool forExport; // xxList is V2Ray format string list QStringList domainListDNSDirect; // config format QJsonArray routingRules; QJsonArray inbounds; QJsonArray outbounds; QJsonArray endpoints; }; bool IsValid(const std::shared_ptr &ent); std::shared_ptr BuildTestConfig(const QList>& profiles); std::shared_ptr BuildConfig(const std::shared_ptr &ent, bool forTest, bool forExport, int chainID = 0); void BuildConfigSingBox(const std::shared_ptr &status); QString BuildChain(int chainId, const std::shared_ptr &status); QString BuildChainInternal(int chainId, const QList> &ents, const std::shared_ptr &status); void BuildOutbound(const std::shared_ptr &ent, const std::shared_ptr &status, QJsonObject& outbound, const QString& tag); } // namespace Configs