subexport.h 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef SUBEXPORT_H_INCLUDED
  2. #define SUBEXPORT_H_INCLUDED
  3. #include <string>
  4. #include <vector>
  5. #include <future>
  6. #include "misc.h"
  7. #include "ini_reader.h"
  8. #include "nodeinfo.h"
  9. struct ruleset_content
  10. {
  11. std::string rule_group;
  12. std::string rule_path;
  13. std::shared_future<std::string> rule_content;
  14. };
  15. struct extra_settings
  16. {
  17. bool enable_rule_generator = true;
  18. bool overwrite_original_rules = true;
  19. string_array rename_array;
  20. string_array emoji_array;
  21. bool add_emoji = false;
  22. bool remove_emoji = false;
  23. bool append_proxy_type = false;
  24. bool udp = false;
  25. bool tfo = false;
  26. bool nodelist = false;
  27. bool sort_flag = false;
  28. bool skip_cert_verify = false;
  29. bool filter_deprecated = false;
  30. bool clash_new_field_name = false;
  31. std::string surge_ssr_path;
  32. std::string managed_config_prefix;
  33. std::string quanx_dev_id;
  34. };
  35. void rulesetToClash(YAML::Node &base_rule, std::vector<ruleset_content> &ruleset_content_array, bool overwrite_original_rules, bool new_field_name);
  36. void rulesetToSurge(INIReader &base_rule, std::vector<ruleset_content> &ruleset_content_array, int surge_ver, bool overwrite_original_rules, std::string remote_path_prefix);
  37. void preprocessNodes(std::vector<nodeInfo> &nodes, extra_settings &ext);
  38. std::string netchToClash(std::vector<nodeInfo> &nodes, std::string &base_conf, std::vector<ruleset_content> &ruleset_content_array, string_array &extra_proxy_group, bool clashR, extra_settings &ext);
  39. void netchToClash(std::vector<nodeInfo> &nodes, YAML::Node &yamlnode, string_array &extra_proxy_group, bool clashR, extra_settings &ext);
  40. std::string netchToSurge(std::vector<nodeInfo> &nodes, std::string &base_conf, std::vector<ruleset_content> &ruleset_content_array, string_array &extra_proxy_group, int surge_ver, extra_settings &ext);
  41. std::string netchToMellow(std::vector<nodeInfo> &nodes, std::string &base_conf, std::vector<ruleset_content> &ruleset_content_array, string_array &extra_proxy_group, extra_settings &ext);
  42. void netchToMellow(std::vector<nodeInfo> &nodes, INIReader &ini, std::vector<ruleset_content> &ruleset_content_array, string_array &extra_proxy_group, extra_settings &ext);
  43. std::string netchToLoon(std::vector<nodeInfo> &nodes, std::string &base_conf, std::vector<ruleset_content> &ruleset_content_array, string_array &extra_proxy_group, extra_settings &ext);
  44. std::string netchToSS(std::vector<nodeInfo> &nodes, extra_settings &ext);
  45. std::string netchToSSSub(std::string &base_conf, std::vector<nodeInfo> &nodes, extra_settings &ext);
  46. std::string netchToSSR(std::vector<nodeInfo> &nodes, extra_settings &ext);
  47. std::string netchToVMess(std::vector<nodeInfo> &nodes, extra_settings &ext);
  48. std::string netchToTrojan(std::vector<nodeInfo> &nodes, extra_settings &ext);
  49. std::string netchToQuanX(std::vector<nodeInfo> &nodes, std::string &base_conf, std::vector<ruleset_content> &ruleset_content_array, string_array &extra_proxy_group, extra_settings &ext);
  50. void netchToQuanX(std::vector<nodeInfo> &nodes, INIReader &ini, std::vector<ruleset_content> &ruleset_content_array, string_array &extra_proxy_group, extra_settings &ext);
  51. std::string netchToQuan(std::vector<nodeInfo> &nodes, std::string &base_conf, std::vector<ruleset_content> &ruleset_content_array, string_array &extra_proxy_group, extra_settings &ext);
  52. void netchToQuan(std::vector<nodeInfo> &nodes, INIReader &ini, std::vector<ruleset_content> &ruleset_content_array, string_array &extra_proxy_group, extra_settings &ext);
  53. std::string netchToSSD(std::vector<nodeInfo> &nodes, std::string &group, std::string &userinfo, extra_settings &ext);
  54. #endif // SUBEXPORT_H_INCLUDED