mirror of
https://github.com/XRPLF/rippled.git
synced 2026-10-09 05:08:27 +00:00
refactor: Make the config name constants constexpr string views (#8332)
Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com>
This commit is contained in:
2
.github/scripts/rename/config.sh
vendored
2
.github/scripts/rename/config.sh
vendored
@@ -62,7 +62,7 @@ ${SED_COMMAND} -i 's@ripple/@xrpld/@g' src/test/core/Config_test.cpp
|
||||
${SED_COMMAND} -i 's/Rippled/File/g' src/test/core/Config_test.cpp
|
||||
|
||||
# Restore the old config file name in the code that maintains support for now.
|
||||
${SED_COMMAND} -i 's/kConfigLegacyName = "xrpld.cfg"/kConfigLegacyName = "rippled.cfg"/g' src/xrpld/core/detail/Config.cpp
|
||||
${SED_COMMAND} -i 's/kConfigLegacyName = "xrpld.cfg"/kConfigLegacyName = "rippled.cfg"/g' src/xrpld/core/Config.h
|
||||
|
||||
# Restore an URL.
|
||||
${SED_COMMAND} -i 's/connect-your-xrpld-to-the-xrp-test-net.html/connect-your-rippled-to-the-xrp-test-net.html/g' cfg/xrpld-example.cfg
|
||||
|
||||
2
.github/scripts/rename/docs.sh
vendored
2
.github/scripts/rename/docs.sh
vendored
@@ -90,7 +90,7 @@ ${SED_COMMAND} -i 's/www.ripple.com/www.xrpl.org/g' src/test/protocol/Seed_test.
|
||||
# Restore specific changes.
|
||||
${SED_COMMAND} -i 's@b5efcc/src/xrpld@b5efcc/src/ripple@' include/xrpl/protocol/README.md
|
||||
${SED_COMMAND} -i 's/dbPrefix_ = "xrpldb"/dbPrefix_ = "rippledb"/' src/xrpld/app/misc/SHAMapStoreImp.h # cspell: disable-line
|
||||
${SED_COMMAND} -i 's/kConfigLegacyName = "xrpld.cfg"/kConfigLegacyName = "rippled.cfg"/' src/xrpld/core/detail/Config.cpp
|
||||
${SED_COMMAND} -i 's/kConfigLegacyName = "xrpld.cfg"/kConfigLegacyName = "rippled.cfg"/' src/xrpld/core/Config.h
|
||||
|
||||
popd
|
||||
echo "Renaming complete."
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <filesystem>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <unordered_set>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@@ -88,10 +89,10 @@ class Config : public BasicConfig
|
||||
{
|
||||
public:
|
||||
// Settings related to the configuration file location and directories
|
||||
static char const* const kConfigFileName;
|
||||
static char const* const kConfigLegacyName;
|
||||
static char const* const kDatabaseDirName;
|
||||
static char const* const kValidatorsFileName;
|
||||
static constexpr std::string_view kConfigFileName = "xrpld.cfg";
|
||||
static constexpr std::string_view kConfigLegacyName = "rippled.cfg";
|
||||
static constexpr std::string_view kDatabaseDirName = "db";
|
||||
static constexpr std::string_view kValidatorsFileName = "validators.txt";
|
||||
|
||||
/**
|
||||
* Returns the full path and filename of the debug log file.
|
||||
|
||||
@@ -246,11 +246,6 @@ getSingleSection(
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
char const* const Config::kConfigFileName = "xrpld.cfg";
|
||||
char const* const Config::kConfigLegacyName = "rippled.cfg";
|
||||
char const* const Config::kDatabaseDirName = "db";
|
||||
char const* const Config::kValidatorsFileName = "validators.txt";
|
||||
|
||||
[[nodiscard]] static std::string
|
||||
getEnvVar(char const* name)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user