PineForge unreleased
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
pineforge::checked_settings Namespace Reference

Data Structures

struct  Error
 
class  LatchedSettingsFailure
 A thrown legacy setter's original message, propagated to native begin. More...
 
struct  Setting
 

Functions

void require (bool condition, const char *message, int status=PF_SETTINGS_INVALID_ARGUMENT)
 
void copy_error (char *error, std::size_t capacity, const char *message) noexcept
 
template<typename Function>
int boundary (char *error, std::size_t capacity, Function &&function) noexcept
 
std::string number (double value)
 
template<typename Integer, std::enable_if_t< std::is_integral_v< Integer > &&!std::is_same_v< Integer, bool >, int > = 0>
std::string number (Integer value)
 
std::string number (bool value)
 
std::int64_t integer (const std::string &value, int bits=32)
 
double real (const std::string &value)
 
std::string validate (const Setting &setting, const std::string &value)
 
std::string quote (const std::string &value)
 
std::string describe (const Setting &setting, const std::string &effective)
 
void receipt (const std::string &document, char *json, std::size_t capacity, std::size_t *required)
 

Function Documentation

◆ require()

void pineforge::checked_settings::require ( bool condition,
const char * message,
int status = PF_SETTINGS_INVALID_ARGUMENT )
inline

Definition at line 33 of file checked_settings.hpp.

References PF_SETTINGS_INVALID_ARGUMENT.

Referenced by integer(), real(), receipt(), and validate().

◆ copy_error()

void pineforge::checked_settings::copy_error ( char * error,
std::size_t capacity,
const char * message )
inlinenoexcept

Definition at line 38 of file checked_settings.hpp.

Referenced by boundary().

◆ boundary()

template<typename Function>
int pineforge::checked_settings::boundary ( char * error,
std::size_t capacity,
Function && function )
noexcept

◆ number() [1/3]

std::string pineforge::checked_settings::number ( double value)
inline

Definition at line 62 of file checked_settings.hpp.

Referenced by validate().

◆ number() [2/3]

template<typename Integer, std::enable_if_t< std::is_integral_v< Integer > &&!std::is_same_v< Integer, bool >, int > = 0>
std::string pineforge::checked_settings::number ( Integer value)
inline

Definition at line 72 of file checked_settings.hpp.

◆ number() [3/3]

std::string pineforge::checked_settings::number ( bool value)
inline

Definition at line 73 of file checked_settings.hpp.

◆ integer()

std::int64_t pineforge::checked_settings::integer ( const std::string & value,
int bits = 32 )
inline

Definition at line 75 of file checked_settings.hpp.

References pineforge::integer, PF_SETTINGS_INVALID_ARGUMENT, and require().

◆ real()

double pineforge::checked_settings::real ( const std::string & value)
inline

Definition at line 139 of file checked_settings.hpp.

References pineforge::number, PF_SETTINGS_INVALID_ARGUMENT, and require().

Referenced by validate().

◆ validate()

◆ quote()

std::string pineforge::checked_settings::quote ( const std::string & value)
inline

Definition at line 244 of file checked_settings.hpp.

Referenced by describe().

◆ describe()

◆ receipt()

void pineforge::checked_settings::receipt ( const std::string & document,
char * json,
std::size_t capacity,
std::size_t * required )
inline

Definition at line 289 of file checked_settings.hpp.

References PF_SETTINGS_BUFFER_TOO_SMALL, and require().