mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-18 04:54:38 +03:00
upload code
This commit is contained in:
54
fmt/AbstractBean.hpp
Normal file
54
fmt/AbstractBean.hpp
Normal file
@@ -0,0 +1,54 @@
|
||||
#pragma once
|
||||
|
||||
#include "main/NekoRay.hpp"
|
||||
|
||||
namespace NekoRay::fmt {
|
||||
|
||||
struct CoreObjOutboundBuildResult {
|
||||
public:
|
||||
QJsonObject outbound;
|
||||
QString error;
|
||||
};
|
||||
|
||||
struct ExternalBuildResult {
|
||||
public:
|
||||
QString program;
|
||||
QStringList env;
|
||||
QStringList arguments;
|
||||
QString error;
|
||||
};
|
||||
|
||||
class AbstractBean : public JsonStore {
|
||||
public:
|
||||
int version;
|
||||
QString name = "";
|
||||
QString serverAddress = "127.0.0.1";
|
||||
int serverPort = 1080;
|
||||
|
||||
explicit AbstractBean(int version);
|
||||
|
||||
QString ToNekorayShareLink(const QString &type);
|
||||
|
||||
[[nodiscard]] virtual QString DisplayAddress();
|
||||
|
||||
[[nodiscard]] virtual QString DisplayName();
|
||||
|
||||
virtual QString DisplayType() { return {}; };
|
||||
|
||||
virtual QString DisplayTypeAndName();
|
||||
|
||||
virtual bool NeedExternal() { return false; };
|
||||
|
||||
virtual CoreObjOutboundBuildResult BuildCoreObj() { return {}; };
|
||||
|
||||
virtual ExternalBuildResult BuildExternal(int mapping_port, int socks_port) { return {}; };
|
||||
|
||||
virtual QString ToShareLink() { return {}; };
|
||||
|
||||
virtual QString InsecureHint() { return {}; };
|
||||
|
||||
};
|
||||
|
||||
QString DisplayInsecureHint(const QSharedPointer<AbstractBean> &);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user