archive/Plugin: return std::unique_ptr<ArchiveFile>
This commit is contained in:
@@ -102,13 +102,13 @@ Bzip2InputStream::Open()
|
||||
|
||||
/* archive open && listing routine */
|
||||
|
||||
static ArchiveFile *
|
||||
static std::unique_ptr<ArchiveFile>
|
||||
bz2_open(Path pathname)
|
||||
{
|
||||
static Mutex mutex;
|
||||
static Cond cond;
|
||||
auto is = OpenLocalInputStream(pathname, mutex, cond);
|
||||
return new Bzip2ArchiveFile(pathname, std::move(is));
|
||||
return std::make_unique<Bzip2ArchiveFile>(pathname, std::move(is));
|
||||
}
|
||||
|
||||
/* single archive handling */
|
||||
|
@@ -116,10 +116,10 @@ Iso9660ArchiveFile::Visit(char *path, size_t length, size_t capacity,
|
||||
_cdio_list_free (entlist, true);
|
||||
}
|
||||
|
||||
static ArchiveFile *
|
||||
static std::unique_ptr<ArchiveFile>
|
||||
iso9660_archive_open(Path pathname)
|
||||
{
|
||||
return new Iso9660ArchiveFile(std::make_shared<Iso9660>(pathname));
|
||||
return std::make_unique<Iso9660ArchiveFile>(std::make_shared<Iso9660>(pathname));
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -65,10 +65,10 @@ public:
|
||||
|
||||
/* archive open && listing routine */
|
||||
|
||||
static ArchiveFile *
|
||||
static std::unique_ptr<ArchiveFile>
|
||||
zzip_archive_open(Path pathname)
|
||||
{
|
||||
return new ZzipArchiveFile(std::make_shared<ZzipDir>(pathname));
|
||||
return std::make_unique<ZzipArchiveFile>(std::make_shared<ZzipDir>(pathname));
|
||||
}
|
||||
|
||||
inline void
|
||||
|
Reference in New Issue
Block a user