#pragma once

#include "IBaseClash.h"
#include <yaml-cpp/yaml.h>
#include "CTool.h"
#include "CProcess.h"
#include "Logger.h"
class CLashConfig : public IBaseClash
{
public:
	CLashConfig();
	~CLashConfig(void);

	// 通过 IBaseClash 继承
	virtual BOOL MakeClash() override;

	virtual BOOL InitClash() override;


	// 通过 IBaseClash 继承
	virtual BOOL StartClash() override;

	virtual BOOL StopClash() override;

private:
	YAML::Node buildShadowsocks();
	YAML::Node buildtrojan();
	YAML::Node buildv2ray();
	std::vector<YAML::Node> buildv2rayHost();

	YAML::Node builTunConfig();
	YAML::Node buildDnsConfig();
	std::vector<YAML::Node> buildProxyGroups();
	std::vector<YAML::Node> buildRules();
private:
	void ThreadFun_process_Config(LPARAM lParam);

private:
	int m_socks_port;
	int m_http_port;
	int m_c_port;
	bool   m_is_qut;
	CProcess* m_process;
	AsynTaskHandle<LPARAM>	m_Asyntask;
	Logger*     m_log;
};

