|
#define | DECL_DEPRECATED_ENUMERATOR(Deprecated, Recommended) Deprecated Q_DECL_ENUMERATOR_DEPRECATED_X("Use " #Recommended) = Recommended |
|
#define | SLICE(Object, ToType) ToType{static_cast<const ToType&>(Object)} |
| Copy an object with slicing. More...
|
|
#define | QUO_CSTR(StringConvertible_) std::data(::Quotient::_impl::toUtf8(StringConvertible_)) |
| q(Utf8)Printable that can handle more than just QStrings More...
|
|
#define | QUO_ALARM_X(...) ::Quotient::alarmX(__VA_ARGS__) |
| A negative assertion facility that can be put in an if statement. More...
|
|
#define | QUO_ALARM(...) ::Quotient::alarmX((__VA_ARGS__) ? true : false, "Alarm: " #__VA_ARGS__) |
|
#define | QUO_CHECK(...) !::Quotient::alarmX(!(__VA_ARGS__) ? true : false, "Failing expression: " #__VA_ARGS__) |
| Evaluate the boolean expression and, in Debug mode, assert it to be true. More...
|
|
|
bool | Quotient::alarmX (bool alarmCondition, const auto &msg, [[maybe_unused]] std::source_location loc=std::source_location::current()) |
|
constexpr auto | Quotient::operator""_ls (const char *s, std::size_t size) |
|
| Quotient::QT_IGNORE_DEPRECATIONS (template< typename U > asKeyValueRange(U &) -> asKeyValueRange< U & >;template< typename U > asKeyValueRange(U &&) -> asKeyValueRange< U >;) template< typename InputIt |
|
Pred std::pair< InputIt, ForwardIt > | Quotient::findFirstOf (InputIt first, InputIt last, ForwardIt sFirst, ForwardIt sLast, Pred pred) |
|
template<typename ImplType , typename TypeToDelete = ImplType, typename... ArgTs> |
ImplPtr< ImplType, TypeToDelete > | Quotient::makeImpl (ArgTs &&... args) |
| make_unique for ImplPtr More...
|
|
template<typename ImplType , typename TypeToDelete = ImplType> |
ImplPtr< ImplType, TypeToDelete > | Quotient::acquireImpl (ImplType *from) |
|
template<typename ImplType , typename TypeToDelete = ImplType> |
constexpr ImplPtr< ImplType, TypeToDelete > | Quotient::ZeroImpl () |
|
template<typename T > |
auto | Quotient::makeCStruct (T *(*constructor)(void *), size_t(*sizeFn)(), auto destructor) |
| Create a C structure with pre-programmed deletion logic. More...
|
|
template<typename... FunctorTs> |
| Quotient::Overloads (FunctorTs &&...) -> Overloads< FunctorTs... > |
|
QUOTIENT_API void | Quotient::linkifyUrls (QString &htmlEscapedText) |
|
QUOTIENT_API QString | Quotient::sanitized (const QString &plainText) |
|
QUOTIENT_API QString | Quotient::prettyPrint (const QString &plainText) |
|
QUOTIENT_API QString | Quotient::cacheLocation (QStringView dirName) |
|
QUOTIENT_API qreal | Quotient::stringToHueF (const QString &s) |
|
QUOTIENT_API QString | Quotient::serverPart (const QString &mxId) |
|
QUOTIENT_API QString | Quotient::versionString () |
|
QUOTIENT_API int | Quotient::majorVersion () |
|
QUOTIENT_API int | Quotient::minorVersion () |
|
QUOTIENT_API int | Quotient::patchVersion () |
|
QDebug | Quotient::formatJson (QDebug dbg) |
| QDebug manipulator to setup the stream for JSON output. More...
|
|
QDebug | Quotient::terse (QDebug dbg) |
| Suppress full qualification of enums/QFlags when logging. More...
|
|
QDebug | operator<< (QDebug dbg, std::invocable< QDebug > auto manipFn) |
| A helper operator for QDebug manipulators, e.g. formatJson. More...
|
|
QDebug | operator<< (QDebug dbg, QElapsedTimer et) |
|
template<typename FnT > |
auto | Quotient::lift (FnT &&fn, auto &&... args) |
| Lift an operation into dereferenceable types (std::optional or pointers) More...
|
|
template<typename T1 , typename T2 > |
requires constexpr std::is_assignable_v< T1 &, const T2 & > bool | Quotient::merge (T1 &lhs, const std::optional< T2 > &rhs) |
| Merge the value from an optional. More...
|
|
template<typename StructT > |
constexpr size_t | Quotient::mergeStruct (StructT &lhs, const StructT &rhs, const auto... fields) |
| Merge structure-like types. More...
|
|
QUOTIENT_API bool | Quotient::isGuestUserId (const UserId &uId) |
|
A negative assertion facility that can be put in an if statement.
Unlike most other assertion functions or macros, this doesn't collapse to no-op in Release builds; rather, it sends a critical level message to the log and returns true so that you could immediately return or do some other damage control for Release builds. Also unlike most other assertion functions, AlarmCondition
is the condition for failure, not for health; in other words, Message
is sent to logs (and, in Debug configuration, the assertion fails) if AlarmCondition
holds, not the other way around.
This macro is a trivial wrapper around alarmX(), provided for API uniformity with QUO_ALARM()
Definition at line 83 of file util.h.
#define QUO_CSTR |
( |
|
StringConvertible_ | ) |
std::data(::Quotient::_impl::toUtf8(StringConvertible_)) |
q(Utf8)Printable that can handle more than just QStrings
This macro accepts all kinds of string-like input, from const char* all the way to raw QStringBuilder constructs. It returns a const char*
pointer to a UTF-8 string; if the original input was QChar/u16-based, it creates a temporary buffer to store the UTF-8 representation that is destroyed once the statement containing QUO_CSTR() is done (therefore, ALWAYS copy the result based on QUO_CSTR() contents if you need to store it).
Definition at line 61 of file util.h.
#define SLICE |
( |
|
Object, |
|
|
|
ToType |
|
) |
| ToType{static_cast<const ToType&>(Object)} |
Copy an object with slicing.
Unintended slicing is bad, which is why there's a C++ Core Guideline that basically says "don't slice, or if you do, make it explicit". Sonar and clang-tidy have warnings matching this guideline; unfortunately, those warnings trigger even when you have a dedicated method (as the guideline recommends) that makes a slicing copy.
This macro is meant for cases when slicing is intended: the static cast silences the static analysis warning, and the macro appearance itself makes it very clear that slicing is wanted here. It is made as a macro (not as a function template) to support the case of private inheritance in which a function template would not be able to cast to the private base (see Uri::toUrl() for an example of just that situation).
Definition at line 37 of file util.h.