Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
rpc::validation::TimeFormatValidator Class Referencefinal

Validate that value can be converted to time according to the given format. More...

#include <Validators.hpp>

Public Member Functions

 TimeFormatValidator (std::string format)
 Construct the validator storing format value.
 
MaybeError verify (boost::json::value const &value, std::string_view key) const
 Verify that the JSON value is valid formatted time.
 

Detailed Description

Validate that value can be converted to time according to the given format.

Constructor & Destructor Documentation

◆ TimeFormatValidator()

rpc::validation::TimeFormatValidator::TimeFormatValidator ( std::string format)
inlineexplicit

Construct the validator storing format value.

Parameters
formatThe format to use for time conversion

Member Function Documentation

◆ verify()

MaybeError rpc::validation::TimeFormatValidator::verify ( boost::json::value const & value,
std::string_view key ) const
nodiscard

Verify that the JSON value is valid formatted time.

Parameters
valueThe JSON value representing the outer object
keyThe key used to retrieve the tested value from the outer object
Returns
RippledError::rpcINVALID_PARAMS if validation failed; otherwise no error is returned

The documentation for this class was generated from the following files: