Fix MSVC warning needs to have dll-interface (#1185)

Unfortunately, MSVC exports everything (not only public members) when
__declspec(dllexport) is set at the class level via TAGLIB_EXPORT, which
leads to many "needs to have dll-interface to be used by clients" 4251
warnings issued by MSVC, because the std::unique_ptr pimpls are
exported too. As it is not possible to "unexport" private members,
such a warning has to be explicitly suppressed for these cases or
all public and protected class member now have to be exported
for classes derived from a template (StringList, ByteVectorList,
PropertyMap).
This commit is contained in:
Urs Fleisch 2023-12-10 17:03:40 +01:00
parent ec734bbe08
commit c9486731d9
104 changed files with 170 additions and 10 deletions

View File

@ -61,13 +61,6 @@ if(MSVC)
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endforeach(flag_var)
endif()
# 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
# 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

@ -227,6 +227,7 @@ namespace TagLib {
void read(bool readProperties);
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};
} // namespace APE

View File

@ -164,6 +164,7 @@ namespace TagLib {
private:
class FooterPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FooterPrivate> d;
};

View File

@ -195,6 +195,7 @@ namespace TagLib {
private:
class ItemPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<ItemPrivate> d;
};
} // namespace APE

View File

@ -108,6 +108,7 @@ namespace TagLib {
void analyzeOld(File *file);
class PropertiesPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PropertiesPrivate> d;
};
} // namespace APE

View File

@ -202,6 +202,7 @@ namespace TagLib {
private:
class TagPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<TagPrivate> d;
};
} // namespace APE

View File

@ -197,6 +197,7 @@ namespace TagLib
ByteVector render(const String &name, int kind = 0) const;
class AttributePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::shared_ptr<AttributePrivate> d;
};
} // namespace ASF

View File

@ -129,6 +129,7 @@ namespace TagLib {
void read();
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};
} // namespace ASF

View File

@ -172,6 +172,7 @@ namespace TagLib
private:
class PicturePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::shared_ptr<PicturePrivate> d;
};
} // namespace ASF

View File

@ -154,6 +154,7 @@ namespace TagLib {
private:
class PropertiesPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PropertiesPrivate> d;
};
} // namespace ASF

View File

@ -211,6 +211,7 @@ namespace TagLib {
private:
class TagPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<TagPrivate> d;
};
} // namespace ASF

View File

@ -126,6 +126,7 @@ namespace TagLib {
private:
class AudioPropertiesPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<AudioPropertiesPrivate> d;
};

View File

@ -137,6 +137,7 @@ namespace TagLib {
private:
class TagPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<TagPrivate> d;
};
} // namespace DIIN

View File

@ -283,6 +283,7 @@ namespace TagLib {
unsigned int leadingPadding = 0);
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};
} // namespace DSDIFF

View File

@ -70,6 +70,7 @@ namespace TagLib {
private:
class PropertiesPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PropertiesPrivate> d;
};
} // namespace DSDIFF

View File

@ -127,6 +127,7 @@ namespace TagLib {
void read(AudioProperties::ReadStyle propertiesStyle);
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};
} // namespace DSF

View File

@ -63,6 +63,7 @@ namespace TagLib {
void read(const ByteVector &data);
class PropertiesPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PropertiesPrivate> d;
};
} // namespace DSF

View File

@ -116,6 +116,7 @@ namespace TagLib {
audioPropertiesStyle = AudioProperties::Average) const = 0;
private:
class FileTypeResolverPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FileTypeResolverPrivate> d;
};
@ -137,6 +138,7 @@ namespace TagLib {
audioPropertiesStyle = AudioProperties::Average) const = 0;
private:
class StreamTypeResolverPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<StreamTypeResolverPrivate> d;
};
@ -379,6 +381,7 @@ namespace TagLib {
void parse(IOStream *stream, bool readAudioProperties, AudioProperties::ReadStyle audioPropertiesStyle);
class FileRefPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::shared_ptr<FileRefPrivate> d;
};

View File

@ -324,6 +324,7 @@ namespace TagLib {
void scan();
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};
} // namespace FLAC

View File

@ -63,6 +63,7 @@ namespace TagLib {
private:
class MetadataBlockPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<MetadataBlockPrivate> d;
};
} // namespace FLAC

View File

@ -152,6 +152,7 @@ namespace TagLib {
private:
class PicturePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PicturePrivate> d;
};

View File

@ -101,6 +101,7 @@ namespace TagLib {
void read(const ByteVector &data, offset_t streamLength);
class PropertiesPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PropertiesPrivate> d;
};
} // namespace FLAC

View File

@ -69,6 +69,7 @@ namespace TagLib {
private:
class UnknownMetadataBlockPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<UnknownMetadataBlockPrivate> d;
};
} // namespace FLAC

View File

@ -88,6 +88,7 @@ namespace TagLib {
void read(bool readProperties);
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};
} // namespace IT

View File

@ -93,6 +93,7 @@ namespace TagLib {
private:
class PropertiesPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PropertiesPrivate> d;
};
} // namespace IT

View File

@ -102,6 +102,7 @@ namespace TagLib {
void read(bool readProperties);
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};
} // namespace Mod

View File

@ -63,6 +63,7 @@ namespace TagLib {
bool readU32B(unsigned long &number);
private:
class FileBasePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FileBasePrivate> d;
};
} // namespace Mod

View File

@ -54,6 +54,7 @@ namespace TagLib {
private:
class PropertiesPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PropertiesPrivate> d;
};
} // namespace Mod

View File

@ -182,6 +182,7 @@ namespace TagLib {
private:
class TagPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<TagPrivate> d;
};
} // namespace Mod

View File

@ -94,6 +94,7 @@ namespace TagLib {
private:
class AtomPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<AtomPrivate> d;
};
@ -112,6 +113,7 @@ namespace TagLib {
private:
class AtomsPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<AtomsPrivate> d;
};
} // namespace MP4

View File

@ -70,6 +70,7 @@ namespace TagLib {
private:
class CoverArtPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::shared_ptr<CoverArtPrivate> d;
};

View File

@ -164,6 +164,7 @@ namespace TagLib {
void read(bool readProperties);
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};
} // namespace MP4

View File

@ -81,6 +81,7 @@ namespace TagLib {
private:
class ItemPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::shared_ptr<ItemPrivate> d;
};

View File

@ -247,6 +247,7 @@ namespace TagLib {
static ItemFactory factory;
class ItemFactoryPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<ItemFactoryPrivate> d;
};

View File

@ -91,6 +91,7 @@ namespace TagLib {
void read(File *file, Atoms *atoms);
class PropertiesPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PropertiesPrivate> d;
};
} // namespace MP4

View File

@ -129,6 +129,7 @@ namespace TagLib {
void addItem(const String &name, const Item &value);
class TagPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<TagPrivate> d;
};
} // namespace MP4

View File

@ -222,6 +222,7 @@ namespace TagLib {
void read(bool readProperties);
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};
} // namespace MPC

View File

@ -123,6 +123,7 @@ namespace TagLib {
void readSV8(File *file, offset_t streamLength);
class PropertiesPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PropertiesPrivate> d;
};
} // namespace MPC

View File

@ -86,6 +86,7 @@ namespace TagLib {
private:
class StringHandlerPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<StringHandlerPrivate> d;
};
@ -201,6 +202,7 @@ namespace TagLib {
private:
class TagPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<TagPrivate> d;
};
} // namespace ID3v1

View File

@ -172,6 +172,7 @@ namespace TagLib {
void parseFields(const ByteVector &data) override;
ByteVector renderFields() const override;
class AttachedPictureFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<AttachedPictureFramePrivate> d;
private:

View File

@ -242,6 +242,7 @@ namespace TagLib {
ChapterFrame(const ID3v2::Header *tagHeader, const ByteVector &data, Header *h);
class ChapterFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<ChapterFramePrivate> d;
};
} // namespace ID3v2

View File

@ -172,6 +172,7 @@ namespace TagLib {
CommentsFrame(const ByteVector &data, Header *h);
class CommentsFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<CommentsFramePrivate> d;
};

View File

@ -178,6 +178,7 @@ namespace TagLib {
EventTimingCodesFrame(const ByteVector &data, Header *h);
class EventTimingCodesFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<EventTimingCodesFramePrivate> d;
};

View File

@ -177,6 +177,7 @@ namespace TagLib {
GeneralEncapsulatedObjectFrame(const ByteVector &data, Header *h);
class GeneralEncapsulatedObjectFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<GeneralEncapsulatedObjectFramePrivate> d;
};
} // namespace ID3v2

View File

@ -149,6 +149,7 @@ namespace TagLib {
OwnershipFrame(const ByteVector &data, Header *h);
class OwnershipFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<OwnershipFramePrivate> d;
};

View File

@ -75,6 +75,7 @@ namespace TagLib {
PodcastFrame(const ByteVector &data, Header *h);
class PodcastFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PodcastFramePrivate> d;
};

View File

@ -131,6 +131,7 @@ namespace TagLib {
PopularimeterFrame(const ByteVector &data, Header *h);
class PopularimeterFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PopularimeterFramePrivate> d;
};

View File

@ -103,6 +103,7 @@ namespace TagLib {
PrivateFrame(const ByteVector &data, Header *h);
class PrivateFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PrivateFramePrivate> d;
};

View File

@ -219,6 +219,7 @@ namespace TagLib {
RelativeVolumeFrame(const ByteVector &data, Header *h);
class RelativeVolumeFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<RelativeVolumeFramePrivate> d;
};

View File

@ -225,6 +225,7 @@ namespace TagLib {
SynchronizedLyricsFrame(const ByteVector &data, Header *h);
class SynchronizedLyricsFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<SynchronizedLyricsFramePrivate> d;
};

View File

@ -251,6 +251,7 @@ namespace TagLib {
TableOfContentsFrame(const ID3v2::Header *tagHeader, const ByteVector &data, Header *h);
class TableOfContentsFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<TableOfContentsFramePrivate> d;
};
} // namespace ID3v2

View File

@ -223,6 +223,7 @@ namespace TagLib {
*/
PropertyMap makeTMCLProperties() const;
class TextIdentificationFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<TextIdentificationFramePrivate> d;
};
@ -318,6 +319,7 @@ namespace TagLib {
void checkFields();
class UserTextIdentificationFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<UserTextIdentificationFramePrivate> d;
};

View File

@ -115,6 +115,7 @@ namespace TagLib {
UniqueFileIdentifierFrame(const ByteVector &data, Header *h);
class UniqueFileIdentifierFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<UniqueFileIdentifierFramePrivate> d;
};
} // namespace ID3v2

View File

@ -72,6 +72,7 @@ namespace TagLib {
UnknownFrame(const ByteVector &data, Header *h);
class UnknownFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<UnknownFramePrivate> d;
};

View File

@ -172,6 +172,7 @@ namespace TagLib {
UnsynchronizedLyricsFrame(const ByteVector &data, Header *h);
class UnsynchronizedLyricsFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<UnsynchronizedLyricsFramePrivate> d;
};

View File

@ -85,6 +85,7 @@ namespace TagLib {
private:
class UrlLinkFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<UrlLinkFramePrivate> d;
};
@ -182,6 +183,7 @@ namespace TagLib {
private:
class UserUrlLinkFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<UserUrlLinkFramePrivate> d;
};

View File

@ -85,6 +85,7 @@ namespace TagLib {
private:
class ExtendedHeaderPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<ExtendedHeaderPrivate> d;
};

View File

@ -74,6 +74,7 @@ namespace TagLib {
private:
class FooterPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FooterPrivate> d;
};

View File

@ -264,6 +264,7 @@ namespace TagLib {
private:
class FramePrivate;
friend class FramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FramePrivate> d;
};
@ -427,6 +428,7 @@ namespace TagLib {
private:
class HeaderPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<HeaderPrivate> d;
};

View File

@ -178,6 +178,7 @@ namespace TagLib {
static FrameFactory factory;
class FrameFactoryPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FrameFactoryPrivate> d;
};

View File

@ -167,6 +167,7 @@ namespace TagLib {
private:
class HeaderPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<HeaderPrivate> d;
};

View File

@ -80,6 +80,7 @@ namespace TagLib {
private:
class Latin1StringHandlerPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<Latin1StringHandlerPrivate> d;
};
@ -395,6 +396,7 @@ namespace TagLib {
private:
class TagPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<TagPrivate> d;
};

View File

@ -328,6 +328,7 @@ namespace TagLib {
offset_t findID3v2(Properties::ReadStyle readStyle);
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};
} // namespace MPEG

View File

@ -193,6 +193,7 @@ namespace TagLib {
void parse(File *file, offset_t offset, bool checkLength);
class HeaderPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::shared_ptr<HeaderPrivate> d;
};
} // namespace MPEG

View File

@ -133,6 +133,7 @@ namespace TagLib {
void read(File *file, ReadStyle readStyle);
class PropertiesPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PropertiesPrivate> d;
};
} // namespace MPEG

View File

@ -112,6 +112,7 @@ namespace TagLib {
void parse(const ByteVector &data);
class XingHeaderPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<XingHeaderPrivate> d;
};
} // namespace MPEG

View File

@ -160,6 +160,7 @@ namespace TagLib {
ByteVector xiphCommentData();
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};
} // namespace FLAC

View File

@ -118,6 +118,7 @@ namespace TagLib {
void writePacket(unsigned int i, const ByteVector &packet);
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};

View File

@ -211,6 +211,7 @@ namespace TagLib {
private:
class PagePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PagePrivate> d;
};
} // namespace Ogg

View File

@ -223,6 +223,7 @@ namespace TagLib {
ByteVector lacingValues() const;
class PageHeaderPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PageHeaderPrivate> d;
};

View File

@ -128,6 +128,7 @@ namespace TagLib {
void read(bool readProperties);
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};
} // namespace Opus

View File

@ -105,6 +105,7 @@ namespace TagLib {
void read(File *file);
class PropertiesPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PropertiesPrivate> d;
};
} // namespace Opus

View File

@ -128,6 +128,7 @@ namespace TagLib {
void read(bool readProperties);
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};
} // namespace Speex

View File

@ -100,6 +100,7 @@ namespace TagLib {
void read(File *file);
class PropertiesPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PropertiesPrivate> d;
};
} // namespace Speex

View File

@ -137,6 +137,7 @@ namespace TagLib {
void read(bool readProperties);
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};
} // namespace Vorbis

View File

@ -121,6 +121,7 @@ namespace TagLib {
void read(File *file);
class PropertiesPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PropertiesPrivate> d;
};
} // namespace Vorbis

View File

@ -262,6 +262,7 @@ namespace TagLib {
private:
class XiphCommentPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<XiphCommentPrivate> d;
};
} // namespace Ogg

View File

@ -156,6 +156,7 @@ namespace TagLib {
friend class Properties;
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};
} // namespace AIFF

View File

@ -121,6 +121,7 @@ namespace TagLib {
void read(File *file);
class PropertiesPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PropertiesPrivate> d;
};
} // namespace AIFF

View File

@ -153,6 +153,7 @@ namespace TagLib {
void updateGlobalSize();
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};
} // namespace RIFF

View File

@ -80,6 +80,7 @@ namespace TagLib {
private:
class StringHandlerPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<StringHandlerPrivate> d;
};
@ -194,6 +195,7 @@ namespace TagLib {
private:
class TagPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<TagPrivate> d;
};
} // namespace Info

View File

@ -207,6 +207,7 @@ namespace TagLib {
friend class Properties;
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};
} // namespace WAV

View File

@ -109,6 +109,7 @@ namespace TagLib {
void read(File *file);
class PropertiesPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PropertiesPrivate> d;
};
} // namespace WAV

View File

@ -104,6 +104,7 @@ namespace TagLib {
void read(bool readProperties);
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};
} // namespace S3M

View File

@ -80,6 +80,7 @@ namespace TagLib {
private:
class PropertiesPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PropertiesPrivate> d;
};
} // namespace S3M

View File

@ -244,6 +244,7 @@ namespace TagLib {
private:
class TagPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<TagPrivate> d;
};
} // namespace TagLib

View File

@ -40,4 +40,19 @@
#define TAGLIB_EXPORT
#endif
#if defined _MSC_VER && !defined TAGLIB_STATIC
/*!
* Suppress MSVC C4251 warning for next statement.
* Unfortunately, MSVC exports everything (not only public members) when
* __declspec(dllexport) is set at the class level via TAGLIB_EXPORT, which
* leads to many "needs to have dll-interface to be used by clients" C4251
* warnings issued by MSVC, because the std::unique_ptr pimpls are
* exported too. This macro can be used before private STL fields to suppress
* such warnings.
*/
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE _Pragma("warning(suppress: 4251)")
#else
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
#endif
#endif

View File

@ -644,6 +644,7 @@ namespace TagLib {
private:
class ByteVectorPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<ByteVectorPrivate> d;
};
} // namespace TagLib

View File

@ -38,18 +38,20 @@ namespace TagLib {
* A List specialization with some handy features useful for ByteVectors.
*/
class TAGLIB_EXPORT ByteVectorList : public List<ByteVector>
class ByteVectorList : public List<ByteVector>
{
public:
/*!
* Construct an empty ByteVectorList.
*/
TAGLIB_EXPORT
ByteVectorList();
/*!
* Destroys this ByteVectorList instance.
*/
TAGLIB_EXPORT
~ByteVectorList();
/*!
@ -57,20 +59,25 @@ namespace TagLib {
* implicitly shared, this method is lightweight and suitable for
* pass-by-value usage.
*/
TAGLIB_EXPORT
ByteVectorList(const ByteVectorList &l);
/*!
* Construct a ByteVectorList with the contents of the braced initializer list.
*/
TAGLIB_EXPORT
ByteVectorList(std::initializer_list<ByteVector> init);
TAGLIB_EXPORT
ByteVectorList &operator=(const ByteVectorList &);
TAGLIB_EXPORT
ByteVectorList &operator=(std::initializer_list<ByteVector> init);
/*!
* Convert the ByteVectorList to a ByteVector separated by \a separator. By
* default a space is used.
*/
TAGLIB_EXPORT
ByteVector toByteVector(const ByteVector &separator = " ") const;
/*!
@ -80,6 +87,7 @@ namespace TagLib {
* is 2 then a maximum of 1 match will be found and the vector will be split
* on that match.
*/
TAGLIB_EXPORT
static ByteVectorList split(const ByteVector &v, const ByteVector &pattern,
int byteAlign = 1, int max = 0);
private:

View File

@ -140,6 +140,7 @@ namespace TagLib {
private:
class ByteVectorStreamPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<ByteVectorStreamPrivate> d;
};

View File

@ -56,6 +56,7 @@ namespace TagLib
private:
class DebugListenerPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<DebugListenerPrivate> d;
};

View File

@ -319,6 +319,7 @@ namespace TagLib {
private:
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};

View File

@ -154,6 +154,7 @@ namespace TagLib {
private:
class FileStreamPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FileStreamPrivate> d;
};

View File

@ -48,6 +48,7 @@ namespace TagLib {
String toString() const;
private:
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
const std::wstring m_wname;
};
#else
@ -162,6 +163,7 @@ namespace TagLib {
private:
class IOStreamPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<IOStreamPrivate> d;
};

View File

@ -115,16 +115,19 @@ namespace TagLib {
*
*/
class TAGLIB_EXPORT PropertyMap: public SimplePropertyMap
class PropertyMap: public SimplePropertyMap
{
public:
using Iterator = SimplePropertyMap::Iterator;
using ConstIterator = SimplePropertyMap::ConstIterator;
TAGLIB_EXPORT
PropertyMap();
TAGLIB_EXPORT
PropertyMap(const PropertyMap &m);
TAGLIB_EXPORT
PropertyMap &operator=(const PropertyMap &other);
/*!
@ -132,8 +135,10 @@ namespace TagLib {
* entries from \a m that have valid keys.
* Invalid keys will be appended to the unsupportedData() list.
*/
TAGLIB_EXPORT
PropertyMap(const SimplePropertyMap &m);
TAGLIB_EXPORT
~PropertyMap();
/*!
@ -142,6 +147,7 @@ namespace TagLib {
* The returned value indicates success, i.e. whether \a key is a
* valid key.
*/
TAGLIB_EXPORT
bool insert(const String &key, const StringList &values);
/*!
@ -150,21 +156,25 @@ namespace TagLib {
* The returned value indicates success, i.e. whether \a key is a
* valid key.
*/
TAGLIB_EXPORT
bool replace(const String &key, const StringList &values);
/*!
* Find the first occurrence of \a key.
*/
TAGLIB_EXPORT
Iterator find(const String &key);
/*!
* Find the first occurrence of \a key.
*/
TAGLIB_EXPORT
ConstIterator find(const String &key) const;
/*!
* Returns true if the map contains values for \a key.
*/
TAGLIB_EXPORT
bool contains(const String &key) const;
/*!
@ -172,16 +182,19 @@ namespace TagLib {
* and the values coincide for that keys. Does not take
* the unsupportedData list into account.
*/
TAGLIB_EXPORT
bool contains(const PropertyMap &other) const;
/*!
* Erase the \a key and its values from the map.
*/
TAGLIB_EXPORT
PropertyMap &erase(const String &key);
/*!
* Erases from this map all keys that appear in \a other.
*/
TAGLIB_EXPORT
PropertyMap &erase(const PropertyMap &other);
/*!
@ -190,6 +203,7 @@ namespace TagLib {
* are appended to that of the first.
* The unsupportedData() lists are concatenated as well.
*/
TAGLIB_EXPORT
PropertyMap &merge(const PropertyMap &other);
/*!
@ -198,6 +212,7 @@ namespace TagLib {
* If the map does not contain \a key, it returns defaultValue.
* If no defaultValue is specified, it returns an empty string list.
*/
TAGLIB_EXPORT
StringList value(const String &key,
const StringList &defaultValue = StringList()) const;
@ -207,6 +222,7 @@ namespace TagLib {
* \note: If \a key is not contained in the map, an empty
* StringList is returned without error.
*/
TAGLIB_EXPORT
const StringList &operator[](const String &key) const;
/*!
@ -216,16 +232,19 @@ namespace TagLib {
* StringList is returned. You can also directly add entries
* by using this function as an lvalue.
*/
TAGLIB_EXPORT
StringList &operator[](const String &key);
/*!
* Returns true if and only if \a other has the same contents as this map.
*/
TAGLIB_EXPORT
bool operator==(const PropertyMap &other) const;
/*!
* Returns false if and only \a other has the same contents as this map.
*/
TAGLIB_EXPORT
bool operator!=(const PropertyMap &other) const;
/*!
@ -237,6 +256,7 @@ namespace TagLib {
* those unsupported elements if you call File::setProperties() with the
* same PropertyMap as argument.
*/
TAGLIB_EXPORT
const StringList &unsupportedData() const;
/*!
@ -244,13 +264,16 @@ namespace TagLib {
*
* \see unsupportedData()
*/
TAGLIB_EXPORT
void addUnsupportedData(const String &key);
/*!
* Removes all entries which have an empty value list.
*/
TAGLIB_EXPORT
void removeEmpty();
TAGLIB_EXPORT
String toString() const;
private:

View File

@ -517,6 +517,7 @@ namespace TagLib {
private:
class StringPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::shared_ptr<StringPrivate> d;
};
} // namespace TagLib

View File

@ -42,13 +42,14 @@ namespace TagLib {
* string operations.
*/
class TAGLIB_EXPORT StringList : public List<String>
class StringList : public List<String>
{
public:
/*!
* Constructs an empty StringList.
*/
TAGLIB_EXPORT
StringList();
/*!
@ -56,19 +57,24 @@ namespace TagLib {
* implicitly shared, this method is lightweight and suitable for
* pass-by-value usage.
*/
TAGLIB_EXPORT
StringList(const StringList &l);
/*!
* Construct a StringList with the contents of the braced initializer list.
*/
TAGLIB_EXPORT
StringList(std::initializer_list<String> init);
TAGLIB_EXPORT
StringList &operator=(const StringList &);
TAGLIB_EXPORT
StringList &operator=(std::initializer_list<String> init);
/*!
* Constructs a StringList with \a s as a member.
*/
TAGLIB_EXPORT
StringList(const String &s);
/*!
@ -77,34 +83,40 @@ namespace TagLib {
* \note This should only be used with the 8-bit codecs Latin1 and UTF8, when
* used with other codecs it will simply print a warning and exit.
*/
TAGLIB_EXPORT
StringList(const ByteVectorList &bl, String::Type t = String::Latin1);
/*!
* Destroys this StringList instance.
*/
TAGLIB_EXPORT
~StringList();
/*!
* Concatenate the list of strings into one string separated by \a separator.
*/
TAGLIB_EXPORT
String toString(const String &separator = " ") const;
/*!
* Appends \a s to the end of the list and returns a reference to the
* list.
*/
TAGLIB_EXPORT
StringList &append(const String &s);
/*!
* Appends all of the values in \a l to the end of the list and returns a
* reference to the list.
*/
TAGLIB_EXPORT
StringList &append(const StringList &l);
/*!
* Splits the String \a s into several strings at \a pattern. This will not include
* the pattern in the returned strings.
*/
TAGLIB_EXPORT
static StringList split(const String &s, const String &pattern);
private:

View File

@ -176,6 +176,7 @@ namespace TagLib {
private:
friend std::ostream& ::operator<<(std::ostream &s, const TagLib::Variant &v);
class VariantPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::shared_ptr<VariantPrivate> d;
};

View File

@ -243,6 +243,7 @@ namespace TagLib {
void read(bool readProperties);
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};
} // namespace TrueAudio

View File

@ -112,6 +112,7 @@ namespace TagLib {
void read(const ByteVector &data, offset_t streamLength);
class PropertiesPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PropertiesPrivate> d;
};
} // namespace TrueAudio

Some files were not shown because too many files have changed in this diff Show More