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>
71 retObj[jss::first] = firstVersion.
print();
72 retObj[jss::good] = goodVersion.print();
73 retObj[jss::last] = lastVersion.print();
106 auto const specifiedVersion = jv[jss::api_version];
107 if (!specifiedVersion.isInt() && !specifiedVersion.isUInt())
111 auto const specifiedVersionInt = specifiedVersion.
asInt();
112 if (specifiedVersionInt < minVersion || specifiedVersionInt > maxVersion)
116 return specifiedVersionInt;
125template <
unsigned minVer,
unsigned maxVer,
typename Fn,
typename... Args>
129 (maxVer >= minVer) &&
136 constexpr auto size = maxVer + 1 - minVer;
142template <
typename Fn,
typename... Args>
146 forApiVersions<RPC::apiMinimumSupportedVersion, RPC::apiMaximumValidVersion>(fn,
std::forward<Args>(args)...);
149 forApiVersions<RPC::apiMinimumSupportedVersion, RPC::apiMaximumValidVersion>(fn,
std::forward<Args>(args)...);
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)