2017-12-17 17:01:37 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <fmt/format.h>
|
2017-12-22 14:10:29 +01:00
|
|
|
#include <QUuid>
|
2017-12-17 17:01:37 +01:00
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
template <typename... Args>
|
|
|
|
auto fS(Args &&... args) -> decltype(fmt::format(std::forward<Args>(args)...))
|
|
|
|
{
|
|
|
|
return fmt::format(std::forward<Args>(args)...);
|
|
|
|
}
|
|
|
|
|
2017-12-22 14:10:29 +01:00
|
|
|
static QString CreateUUID()
|
|
|
|
{
|
|
|
|
auto uuid = QUuid::createUuid();
|
|
|
|
return uuid.toString();
|
|
|
|
}
|
|
|
|
|
2017-12-17 17:01:37 +01:00
|
|
|
} // namespace chatterino
|
2017-12-22 14:07:58 +01:00
|
|
|
|
|
|
|
namespace fmt {
|
|
|
|
|
|
|
|
// format_arg for QString
|
|
|
|
inline void format_arg(BasicFormatter<char> &f, const char *&, const QString &v)
|
|
|
|
{
|
2017-12-22 14:10:29 +01:00
|
|
|
f.writer().write("{}", v.toStdString());
|
2017-12-22 14:07:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace fmt
|