3#include <xrpl/beast/core/SemanticVersion.h>
4#include <xrpl/beast/utility/instrumentation.h>
5#include <xrpl/json/json_value.h>
6#include <xrpl/protocol/jss.h>
37template <
unsigned int Version>
73 retObj[jss::first] = firstVersion.
print();
74 retObj[jss::good] = goodVersion.print();
75 retObj[jss::last] = lastVersion.print();
109 auto const specifiedVersion = jv[jss::api_version];
110 if (!specifiedVersion.isInt() && !specifiedVersion.isUInt())
114 auto const specifiedVersionInt = specifiedVersion.
asInt();
115 if (specifiedVersionInt < minVersion || specifiedVersionInt > maxVersion)
119 return specifiedVersionInt;
128template <
unsigned minVer,
unsigned maxVer,
typename Fn,
typename... Args>
132 (maxVer >= minVer) &&
139 constexpr auto size = maxVer + 1 - minVer;
147template <
typename Fn,
typename... Args>
151 forApiVersions<RPC::apiMinimumSupportedVersion, RPC::apiMaximumValidVersion>(
155 forApiVersions<RPC::apiMinimumSupportedVersion, RPC::apiMaximumValidVersion>(
bool isMember(char const *key) const
Return true if the object has a member named key.
A Semantic Version number.
std::string print() const
Produce a string from semantic version components.
@ objectValue
object value (collection of name/value pairs).
static constexpr auto apiBetaVersion
static constexpr auto apiInvalidVersion
static constexpr auto apiMinimumSupportedVersion
static constexpr auto apiMaximumValidVersion
static constexpr std::integral_constant< unsigned, Version > apiVersion
static constexpr auto apiMaximumSupportedVersion
void setVersion(Json::Value &parent, unsigned int apiVersion, bool betaEnabled)
static constexpr auto apiCommandLineVersion
unsigned int getAPIVersionNumber(Json::Value const &jv, bool betaEnabled)
Retrieve the api version number from the json value.
static constexpr auto apiVersionIfUnspecified
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void forAllApiVersions(Fn const &fn, Args &&... args)
void forApiVersions(Fn const &fn, Args &&... args)