Add [features] section to .cfg:

This non-production config section allows features to be enabled
by listing their text descriptions, one line each, in the config
section titled "features".

NOTE: Feature names with leading or trailing whitespace, or
      containing an equals sign ('=') are not supported.
This commit is contained in:
Vinnie Falco
2015-07-29 07:36:29 -07:00
committed by Edward Hennis
parent 2ec40cb6f1
commit d49f9ea109
11 changed files with 145 additions and 17 deletions

View File

@@ -22,6 +22,7 @@
#include <ripple/core/ConfigSections.h>
#include <ripple/basics/Log.h>
#include <ripple/json/json_reader.h>
#include <ripple/protocol/Feature.h>
#include <ripple/protocol/SystemParameters.h>
#include <ripple/net/HTTPClient.h>
#include <beast/http/URL.h>
@@ -553,6 +554,12 @@ void Config::loadFromString (std::string const& fileContents)
if (getSingleSection (secConfig, SECTION_DEBUG_LOGFILE, strTemp))
DEBUG_LOGFILE = strTemp;
{
auto const part = section("features");
for(auto const& s : part.values())
features.insert(feature(s));
}
}
int Config::getSize (SizedItemName item) const