mirror of
https://github.com/taglib/taglib.git
synced 2026-08-14 06:17:00 -04:00
Use unique_ptr for d-pointers (#1095)
* clang-tidy: make deleted members public One oversight of modernize-use-equals-delete is that the C++11 way of doing this is to make it public, which makes the warning still trigger. Signed-off-by: Rosen Penev <[email protected]> * clang-tidy: add missing deleted functions Found with cppcoreguidelines-special-member-functions Signed-off-by: Rosen Penev <[email protected]> * unique_ptr conversions unique_ptr is a safer and cleaner way to handle d pointers. Also added missing = default. Signed-off-by: Rosen Penev <[email protected]> --------- Signed-off-by: Rosen Penev <[email protected]>
This commit is contained in:
+10
-2
@@ -92,11 +92,15 @@ namespace TagLib {
|
||||
class TAGLIB_EXPORT FileTypeResolver
|
||||
{
|
||||
public:
|
||||
FileTypeResolver();
|
||||
/*!
|
||||
* Destroys this FileTypeResolver instance.
|
||||
*/
|
||||
virtual ~FileTypeResolver() = 0;
|
||||
|
||||
FileTypeResolver(const FileTypeResolver &) = delete;
|
||||
FileTypeResolver &operator=(const FileTypeResolver &) = delete;
|
||||
|
||||
/*!
|
||||
* This method must be overridden to provide an additional file type
|
||||
* resolver. If the resolver is able to determine the file type it should
|
||||
@@ -112,24 +116,28 @@ namespace TagLib {
|
||||
audioPropertiesStyle = AudioProperties::Average) const = 0;
|
||||
private:
|
||||
class FileTypeResolverPrivate;
|
||||
FileTypeResolverPrivate *d;
|
||||
std::unique_ptr<FileTypeResolverPrivate> d;
|
||||
};
|
||||
|
||||
class TAGLIB_EXPORT StreamTypeResolver : public FileTypeResolver
|
||||
{
|
||||
public:
|
||||
StreamTypeResolver();
|
||||
/*!
|
||||
* Destroys this StreamTypeResolver instance.
|
||||
*/
|
||||
~StreamTypeResolver() override = 0;
|
||||
|
||||
StreamTypeResolver(const StreamTypeResolver &) = delete;
|
||||
StreamTypeResolver &operator=(const StreamTypeResolver &) = delete;
|
||||
|
||||
virtual File *createFileFromStream(IOStream *stream,
|
||||
bool readAudioProperties = true,
|
||||
AudioProperties::ReadStyle
|
||||
audioPropertiesStyle = AudioProperties::Average) const = 0;
|
||||
private:
|
||||
class StreamTypeResolverPrivate;
|
||||
StreamTypeResolverPrivate *d;
|
||||
std::unique_ptr<StreamTypeResolverPrivate> d;
|
||||
};
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user