[ox/std] Add std::string and QString support to fmt
This commit is contained in:
parent
75902ba2a3
commit
a2e1ac8851
26
deps/ox/src/ox/std/fmt.hpp
vendored
26
deps/ox/src/ox/std/fmt.hpp
vendored
@ -8,6 +8,15 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#if __has_include(<string>)
|
||||||
|
#include <string>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __has_include(<QString>)
|
||||||
|
#include <QString>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <ox/std/bstring.hpp>
|
||||||
#include <ox/std/string.hpp>
|
#include <ox/std/string.hpp>
|
||||||
#include <ox/std/strops.hpp>
|
#include <ox/std/strops.hpp>
|
||||||
#include <ox/std/types.hpp>
|
#include <ox/std/types.hpp>
|
||||||
@ -19,10 +28,27 @@ constexpr const char *stringify(const char *s) noexcept {
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<std::size_t size>
|
||||||
|
constexpr const char *stringify(const ox::BString<size> &s) noexcept {
|
||||||
|
return s.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
constexpr const char *stringify(const ox::String &s) noexcept {
|
constexpr const char *stringify(const ox::String &s) noexcept {
|
||||||
return s.c_str();
|
return s.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if __has_include(<string>)
|
||||||
|
constexpr const char *stringify(const std::string &s) noexcept {
|
||||||
|
return s.c_str();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __has_include(<QString>)
|
||||||
|
constexpr const char *stringify(const QString &s) noexcept {
|
||||||
|
return s.c_str();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
class FmtArg {
|
class FmtArg {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user