cutelyst 4.3.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
|
Helper functions used all over Cutelyst. More...
Functions | |
CUTELYST_LIBRARY QByteArray | buildTable (const QVector< QStringList > &table, const QStringList &headers={}, const QString &title={}) |
CUTELYST_LIBRARY ParamsMultiMap | decodePercentEncoding (char *data, int len) |
CUTELYST_LIBRARY QString | decodePercentEncoding (QByteArray *ba) |
CUTELYST_LIBRARY QString | decodePercentEncoding (QString *s) |
CUTELYST_LIBRARY std::chrono::microseconds | durationFromString (QStringView str, bool *ok=nullptr) |
Helper functions used all over Cutelyst.
QByteArray Cutelyst::Utils::buildTable | ( | const QVector< QStringList > & | table, |
const QStringList & | headers = {} , |
||
const QString & | title = {} |
||
) |
ParamsMultiMap Cutelyst::Utils::decodePercentEncoding | ( | char * | data, |
int | len | ||
) |
QString Cutelyst::Utils::decodePercentEncoding | ( | QByteArray * | ba | ) |
std::chrono::microseconds Cutelyst::Utils::durationFromString | ( | QStringView | str, |
bool * | ok = nullptr |
||
) |
Reads a time span from str and parses it into a duration value.
The following time units are understood:
If no time unit is specified, seconds are assumed.
Examples for valid time span specifications:
If ok is not nullptr
, failure is reported by setting *ok to false
, and success by setting *ok to true
.
Definition at line 291 of file utils.cpp.
References QString::append(), QString::clear(), QList::emplace_back(), QList::empty(), and QString::isEmpty().
Referenced by Cutelyst::Session::setup(), Cutelyst::CSRFProtection::setup(), and Cutelyst::LangSelect::setup().