26 #include <pluginterfaces/base/ftypes.h> 36 std::wstring_convert<std::codecvt_utf8_utf16<Steinberg::char16>, Steinberg::char16> converter{};
37 return converter.to_bytes(iString);
49 std::string
toUTF8String(T
const &iValue, Steinberg::int32 iPrecision)
51 if constexpr(Utils::is_operator_write_to_ostream_defined<T>)
56 s.precision(iPrecision);
57 s.setf(std::ios::fixed);
77 template<
typename T,
typename... Args>
80 auto ptr =
new T(std::forward<Args>(iArgs)...);
81 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:49
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
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:78
std::string toUT8String(VstString16 const &iString)
Converts a VstString16 to a regular std::string that is properly utf-8 encoded.
Definition: Utils.h:34