Added conversion from String to const wchar_t*

This commit is contained in:
Tsuda Kageyu
2013-06-11 00:09:37 +09:00
parent 7e866e11ad
commit 62d55223b2
3 changed files with 18 additions and 1 deletions

View File

@ -312,6 +312,11 @@ const char *String::toCString(bool unicode) const
return d->cstring.c_str();
}
const wchar_t *String::toCWString() const
{
return d->data.c_str();
}
String::Iterator String::begin()
{
return d->data.begin();

View File

@ -205,7 +205,16 @@ namespace TagLib {
* where memory is critical.
*/
const char *toCString(bool unicode = false) const;
/*!
* Returns a pointer to the wide char version of the TagLib string. The string
* is encoded in UTF-16(without BOM/CPU byte order).
*
* /note This returns a pointer to the String's internal data without any
* conversions.
*/
const wchar_t *toCWString() const;
/*!
* Returns an iterator pointing to the beginning of the string.
*/