cutelyst
4.5.1
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_EXPORT QByteArray | buildTable (const QVector< QStringList > &table, const QStringList &headers={}, const QString &title={}) |
CUTELYST_EXPORT ParamsMultiMap | decodePercentEncoding (char *data, int len) |
CUTELYST_EXPORT QString | decodePercentEncoding (QByteArray *ba) |
CUTELYST_EXPORT QString | decodePercentEncoding (QString *s) |
CUTELYST_EXPORT std::chrono::microseconds | durationFromString (QStringView str, bool *ok=nullptr) |
Helper functions used all over Cutelyst.
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().