Revert "Stop exporting std::string and std::wstring in a public header."

This reverts commit 0e981adcc6daee17eaea6beda92bc2ce320363e8.
This commit is contained in:
Tsuda Kageyu 2015-09-11 19:59:20 +09:00
parent 0e981adcc6
commit 1ff30e55da
3 changed files with 10 additions and 10 deletions

View File

@ -56,10 +56,10 @@ namespace
{
const DWORD access = readOnly ? GENERIC_READ : (GENERIC_READ | GENERIC_WRITE);
if(path.wstr()[0] != L'\0')
return CreateFileW(path.wstr(), access, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
else if(path.str()[0] != '\0')
return CreateFileA(path.str(), access, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
if(!path.wstr().empty())
return CreateFileW(path.wstr().c_str(), access, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
else if(!path.str().empty())
return CreateFileA(path.str().c_str(), access, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
else
return InvalidFileHandle;
}

View File

@ -129,14 +129,14 @@ FileName &FileName::operator=(const FileName &name)
return *this;
}
const wchar_t *FileName::wstr() const
const std::wstring &FileName::wstr() const
{
return d->data->wname.c_str();
return d->data->wname;
}
const char *FileName::str() const
const std::string &FileName::str() const
{
return d->data->name.c_str();
return d->data->name;
}
String FileName::toString() const

View File

@ -46,8 +46,8 @@ namespace TagLib {
FileName &operator=(const FileName &name);
const wchar_t *wstr() const;
const char *str() const;
const std::wstring &wstr() const;
const std::string &str() const;
String toString() const;