Advertisement
Lajamerr_Mittesdine

fmt

Jun 15th, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #pragma once
  2.  
  3. #include <fmt/format.h>
  4. #include <QUuid>
  5.  
  6. namespace chatty {
  7.  
  8. template <typename... Args>
  9. auto fS(Args &&... args) -> decltype(fmt::format(std::forward<Args>(args)...))
  10. {
  11. return fmt::format(std::forward<Args>(args)...);
  12. }
  13.  
  14. static QString CreateUUID()
  15. {
  16. auto uuid = QUuid::createUuid();
  17. return uuid.toString();
  18. }
  19.  
  20. } // namespace chatty
  21.  
  22. namespace fmt {
  23.  
  24. // format_arg for QString
  25. inline void format_arg(BasicFormatter<char> &f, const char *&, const QString &v)
  26. {
  27. f.writer().write("{}", v.toStdString());
  28. }
  29.  
  30. } // namespace fmt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement