1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- #pragma once
- #include "CBaseMode.h"
- #include "CUserInfo.h"
- #include "CServerList.h"
- enum struct PROXY_MODE {
- sys_mode = 0,
- tun_mode,
- };
- enum struct ROUT_MODE{
- cn_mode = 0,
- qg_mode,
- };
- struct SysMode {
- int id;
- PROXY_MODE proxy_mode;
- SStringW name;
- };
- struct RouteMode {
- int id;
- ROUT_MODE route_mode;
- SStringW name;
- };
- class CApp : public SSingleton<CApp>
- {
- public:
- CApp();
- ~CApp();
- void Init();
- void UnInit();
-
- CUserInfo* GetUserinfo();
- CServerList* GetServerList();
- void SetOut(int out);
- int GetOut();
- void SetSysMode(PROXY_MODE mode);
- PROXY_MODE GetSysMode();
- void SetRouteMode(ROUT_MODE mode);
- ROUT_MODE GetRouteMode();
- void SetMethod(HINSTANCE hinst);
- HINSTANCE GetMethod();
-
- //¼ì²â»òÕßÉèÖÃDataĿ¼
- void ChkeAndSetDtaPath();
- bool CheckOnlyOneInstance() noexcept;
- std::filesystem::path GetDataPath();
- std::filesystem::path GetConfigPath();
- std::filesystem::path GetConfigGuiPath();
- void SetupDataDirectory();
- void SetCLashRuning(bool m);
- bool GetClashRuning();
- std::string GetToken() const { return m_token; }
- void SetToken(std::string val) { m_token = val; }
- private:
- int m_is_out;
- CServerList* m_server_list;
- CUserInfo* m_userinfo;
- PROXY_MODE m_proxy_mode;
- ROUT_MODE m_route_mode;
- HINSTANCE m_hInst;
- std::filesystem::path m_dataPath;
- std::filesystem::path m_configPath;
- std::filesystem::path m_config_Gui_Path;
- bool m_clashRuning = true;
- std::string m_token;
- /**/
- };
|