Reading through the MediaInfoLib library's C++ code, it seems there are two possibilities. The library defines a type alias String
, and this is the type you're seeing.
First, here is the definition of the Char
and String
types:
namespace MediaInfoLib {
/* ... */
//Char types
#undef __T
#define __T(__x) __T(__x)
#if defined(UNICODE) || defined (_UNICODE)
typedef wchar_t Char; ///< Unicode/Ansi independant char
#undef __T
#define __T(__x) L ## __x
#else
typedef char Char; ///< Unicode/Ansi independant char
#undef __T
#define __T(__x) __x
#endif
typedef std::basic_string<MediaInfoLib::Char> String; ///< Unicode/Ansi independant string
/* ... */
} // end namespace
If the macro UNICODE
or _UNICODE
was defined when the library was built, then the type is std::basic_string<wchar_t>
, which is std::wstring
in the standard library.
To convert this to std::string
, please see this question:
How to convert wstring into string?
The simplest answer there uses std::wstring_convert
.
If the macro UNICODE
or _UNICODE
was NOT defined when the library was built, then MediaInfoLib::Char
is the type char
, and the MediaInfoLib::String
type is std::basic_string<char>
is already std::string
. That is, in this case, the return type is already std::string.