Windows: Remove unused FileName member, disable two warnings

This commit is contained in:
Urs Fleisch 2023-07-02 22:17:54 +02:00
parent 250dece2ab
commit 322085f90e
4 changed files with 5 additions and 22 deletions

View File

@ -63,8 +63,10 @@ if(MSVC)
# Disable warnings for internal invocations of API functions
# that have been marked with TAGLIB_DEPRECATED
# https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4996
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996")
# Also disable C4910: '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation
# and C4251: needs to have dll-interface to be used by clients.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996 /wd4910 /wd4251")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996 /wd4910 /wd4251")
endif()
# Read version information from file taglib/toolkit/taglib.h into variables

View File

@ -68,7 +68,7 @@ namespace
AudioProperties::ReadStyle audioPropertiesStyle)
{
#ifdef _WIN32
if(::strlen(fileName) == 0 && ::wcslen(fileName) == 0)
if(::wcslen(fileName) == 0)
return 0;
#else
if(::strlen(fileName) == 0)

View File

@ -49,22 +49,17 @@ namespace
}
}
// m_name is no longer used, but kept for backward compatibility.
FileName::FileName(const wchar_t *name) :
m_name(),
m_wname(name)
{
}
FileName::FileName(const char *name) :
m_name(),
m_wname(ansiToUnicode(name))
{
}
FileName::FileName(const FileName &name) :
m_name(),
m_wname(name.m_wname)
{
}
@ -74,21 +69,11 @@ FileName::operator const wchar_t *() const
return m_wname.c_str();
}
FileName::operator const char *() const
{
return m_name.c_str();
}
const std::wstring &FileName::wstr() const
{
return m_wname;
}
const std::string &FileName::str() const
{
return m_name;
}
String FileName::toString() const
{
return String(m_wname.c_str());
@ -111,4 +96,3 @@ IOStream::~IOStream()
void IOStream::clear()
{
}

View File

@ -42,15 +42,12 @@ namespace TagLib {
FileName(const FileName &name);
operator const wchar_t *() const;
operator const char *() const;
const std::wstring &wstr() const;
const std::string &str() const;
String toString() const;
private:
const std::string m_name;
const std::wstring m_wname;
};
#else