26 #include <pluginterfaces/base/ftypes.h> 27 #include <base/source/fstring.h> 33 #pragma clang diagnostic push 34 #pragma clang diagnostic ignored "-Wdeprecated-declarations" 41 std::wstring_convert<std::codecvt_utf8_utf16<Steinberg::char16>, Steinberg::char16> converter{};
42 return converter.to_bytes(iString);
49 #pragma clang diagnostic pop 57 std::string
toUTF8String(T
const &iValue, Steinberg::int32 iPrecision)
59 if constexpr(Utils::is_operator_write_to_ostream_defined<T>)
64 s.precision(iPrecision);
65 s.setf(std::ios::fixed);
76 template<
typename... Args>
80 s.printf(iFormat.c_str(), std::forward<Args>(iArgs)...);
95 template<
typename T,
typename... Args>
98 auto ptr =
new T(std::forward<Args>(iArgs)...);
99 std::shared_ptr<T> sptr(ptr, [](T *p) { p->release(); });
std::string toUTF8String(T const &iValue, Steinberg::int32 iPrecision)
This generic function will determine (at compilation time) whether T can be written to an ostream and...
Definition: Utils.h:57
Definition: ExpiringDataCache.h:27
std::basic_string< Steinberg::char16 > VstString16
Strings made of char16 characters are represented by the native C++11 type std::basic_string<Steinber...
Definition: Types.h:43
VstString16 printf16(VstString16 const &iFormat, Args &&...iArgs)
Equivalent to printf but for VstString16
Definition: Utils.h:77
std::shared_ptr< T > make_sfo(Args &&...iArgs)
The VST SDK uses the concept of FObject (which are self contained reference counted objects) but requ...
Definition: Utils.h:96
std::string toUT8String(VstString16 const &iString)
Converts a VstString16 to a regular std::string that is properly utf-8 encoded.
Definition: Utils.h:39