26#include <pluginterfaces/base/ftypes.h>
27#include <base/source/fstring.h>
37 Steinberg::String utf8Str(iString.c_str());
38 utf8Str.toMultiByte(Steinberg::kCP_Utf8);
39 return utf8Str.text8();
47std::string
toUTF8String(T
const &iValue, Steinberg::int32 iPrecision)
54 s.precision(iPrecision);
55 s.setf(std::ios::fixed);
66template<
typename... Args>
70 s.printf(iFormat.c_str(), std::forward<Args>(iArgs)...);
85template<
typename T,
typename... Args>
88 auto ptr =
new T(std::forward<Args>(iArgs)...);
89 std::shared_ptr<T> sptr(ptr, [](T *p) { p->release(); });
constexpr auto is_operator_write_to_ostream_defined
Allows to detect whether a type defines ostream << x at compile time.
Definition Metaprogramming.h:115
Definition ExpiringDataCache.h:28
std::string toUT8String(VstString16 const &iString)
Converts a VstString16 to a regular std::string that is properly utf-8 encoded.
Definition Utils.h:35
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:47
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:86
VstString16 printf16(VstString16 const &iFormat, Args &&...iArgs)
Equivalent to printf but for VstString16.
Definition Utils.h:67
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:44