2019-07-23 22:18:36 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <fmt/format.h>
|
2019-08-10 13:47:17 +02:00
|
|
|
#include <QString>
|
2019-07-23 22:18:36 +02:00
|
|
|
|
|
|
|
namespace AB_NAMESPACE {
|
|
|
|
|
|
|
|
template <typename... Args>
|
|
|
|
auto fS(Args &&... args)
|
|
|
|
{
|
|
|
|
return fmt::format(std::forward<Args>(args)...);
|
|
|
|
}
|
|
|
|
|
2019-09-18 16:31:51 +02:00
|
|
|
QString generateUuid();
|
2019-07-23 22:18:36 +02:00
|
|
|
|
2019-09-18 16:31:51 +02:00
|
|
|
QString formatRichLink(const QString &url, bool file = false);
|
2019-07-23 22:18:36 +02:00
|
|
|
|
2019-09-18 16:31:51 +02:00
|
|
|
QString formatRichNamedLink(const QString &url, const QString &name,
|
|
|
|
bool file = false);
|
2019-07-23 22:18:36 +02:00
|
|
|
|
2019-08-10 13:47:17 +02:00
|
|
|
QString shortenString(const QString &str, unsigned maxWidth = 50);
|
2019-07-23 22:18:36 +02:00
|
|
|
|
|
|
|
} // namespace AB_NAMESPACE
|
|
|
|
|
|
|
|
namespace fmt {
|
|
|
|
|
|
|
|
// format_arg for QString
|
|
|
|
inline void format_arg(BasicFormatter<char> &f, const char *&, const QString &v)
|
|
|
|
{
|
|
|
|
f.writer().write("{}", v.toStdString());
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace fmt
|