ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
rux::gui::Params Class Reference

Already-decoded query parameters, so handlers never touch crow::request. More...

#include <api.hpp>

Public Member Functions

void set (std::string key, std::string value)
std::optional< std::string > find (std::string_view key) const
std::string str (std::string_view key, std::string fallback) const
 String value, or fallback when absent/empty.
long long integer (std::string_view key, long long fallback) const
 Integer value, or fallback when absent.
std::optional< bool > boolean (std::string_view key) const
 Boolean value, or nullopt when absent/empty.

Detailed Description

Already-decoded query parameters, so handlers never touch crow::request.

Definition at line 118 of file api.hpp.

Member Function Documentation

◆ boolean()

std::optional< bool > rux::gui::Params::boolean ( std::string_view key) const

Boolean value, or nullopt when absent/empty.

Accepts true/false, 1/0, yes/no, any case. Anything else is a 400 rather than a silent false, because a filter that quietly inverts itself on a typo is worse than one that refuses.

Exceptions
HttpError(400)when present but not a recognised boolean.

◆ find()

std::optional< std::string > rux::gui::Params::find ( std::string_view key) const

◆ integer()

long long rux::gui::Params::integer ( std::string_view key,
long long fallback ) const

Integer value, or fallback when absent.

Exceptions
HttpError(400)when present but not a valid integer.

◆ set()

void rux::gui::Params::set ( std::string key,
std::string value )

◆ str()

std::string rux::gui::Params::str ( std::string_view key,
std::string fallback ) const

String value, or fallback when absent/empty.


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