diff options
author | Saturneric <[email protected]> | 2021-08-11 05:21:57 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-08-11 05:21:57 +0000 |
commit | a5cf56e93e4e6a856b2f21730c7bfbfa413410ff (patch) | |
tree | cdfd1bb9eaf5ba7bfce4a7e4512f371d9d75107d /include/server/ComUtils.h | |
parent | Split some source files that are too large. (diff) | |
download | GpgFrontend-a5cf56e93e4e6a856b2f21730c7bfbfa413410ff.tar.gz GpgFrontend-a5cf56e93e4e6a856b2f21730c7bfbfa413410ff.zip |
Continue to improve functions.
Split source files that are too long.
Diffstat (limited to '')
-rw-r--r-- | include/server/ComUtils.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/server/ComUtils.h b/include/server/ComUtils.h index 64f80e87..5f27998e 100644 --- a/include/server/ComUtils.h +++ b/include/server/ComUtils.h @@ -32,16 +32,24 @@ class ComUtils : public QWidget { Q_OBJECT public: + enum ServiceType { GetServiceToken, ShortenCryptText, GetFullCryptText }; + explicit ComUtils(QWidget *parent) : QWidget(parent), appPath(qApp->applicationDirPath()), settings(RESOURCE_DIR(appPath) + "/conf/gpgfrontend.ini", QSettings::IniFormat) { } + QString getUrl(ServiceType type); + bool checkServerReply(const QByteArray &reply); QString getDataValue(const QString &key); + bool checkDataValue(const QString &key); + + bool checkServiceTokenFormat(const QString& serviceToken); + [[nodiscard]] bool good() const { return is_good; } private: @@ -50,6 +58,9 @@ private: QSettings settings; rapidjson::Document replyDoc; rapidjson::Value dataVal; + + QRegularExpression re_uuid{R"(\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)"}; + bool is_good = false; }; |