From 546d23264c8886cad0dc03f2df9c64e999c8573a Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 13 May 2025 11:41:54 +0200 Subject: Core/Misc: Make string and string_view literal suffixes globally available --- src/common/Common.h | 3 +++ src/common/Configuration/Config.cpp | 5 +---- src/common/Cryptography/Authentication/SRP6.cpp | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'src/common') diff --git a/src/common/Common.h b/src/common/Common.h index 847b296d1a4..208809dcdfc 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -22,6 +22,9 @@ #include #include +using namespace std::string_literals; +using namespace std::string_view_literals; + #define STRINGIZE(a) #a enum TimeConstants diff --git a/src/common/Configuration/Config.cpp b/src/common/Configuration/Config.cpp index 3a665783ef7..a0672d56ff6 100644 --- a/src/common/Configuration/Config.cpp +++ b/src/common/Configuration/Config.cpp @@ -16,6 +16,7 @@ */ #include "Config.h" +#include "Common.h" #include "Log.h" #include "StringConvert.h" #include @@ -68,8 +69,6 @@ namespace // LogDB.Opt.ClearTime => LOG_DB_OPT_CLEAR_TIME std::string IniKeyToEnvVarKey(std::string_view const& key) { - using namespace std::string_view_literals; - std::string result; size_t n = key.length(); @@ -317,8 +316,6 @@ std::string ConfigMgr::GetStringDefault(std::string_view name, std::string_view bool ConfigMgr::GetBoolDefault(std::string_view name, bool def, bool quiet) const { - using namespace std::string_view_literals; - std::string val = GetValueDefault(name, def ? "1"sv : "0"sv, quiet); std::erase(val, '"'); if (Optional boolVal = Trinity::StringTo(val)) diff --git a/src/common/Cryptography/Authentication/SRP6.cpp b/src/common/Cryptography/Authentication/SRP6.cpp index e015b8c33f6..25ed10de56a 100644 --- a/src/common/Cryptography/Authentication/SRP6.cpp +++ b/src/common/Cryptography/Authentication/SRP6.cpp @@ -16,14 +16,13 @@ */ #include "SRP6.h" +#include "Common.h" #include "CryptoRandom.h" #include #include namespace Trinity::Crypto::SRP { -using namespace std::string_literals; - BigNumber const GruntSRP6::N = "894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7"s; BigNumber const GruntSRP6::g = 7; -- cgit v1.2.3