Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
1cfc0cb8
Commit
1cfc0cb8
authored
Apr 26, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/io/AutoGunzipReader: use std::unique_ptr<>
parent
3882c975
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
AutoGunzipReader.cxx
src/fs/io/AutoGunzipReader.cxx
+5
-5
AutoGunzipReader.hxx
src/fs/io/AutoGunzipReader.hxx
+4
-4
No files found.
src/fs/io/AutoGunzipReader.cxx
View file @
1cfc0cb8
...
...
@@ -20,10 +20,10 @@
#include "AutoGunzipReader.hxx"
#include "GunzipReader.hxx"
AutoGunzipReader
::
~
AutoGunzipReader
(
)
noexcept
{
delete
gunzip
;
}
AutoGunzipReader
::
AutoGunzipReader
(
Reader
&
_next
)
noexcept
:
peek
(
_next
)
{}
AutoGunzipReader
::~
AutoGunzipReader
()
noexcept
=
default
;
gcc_pure
static
bool
...
...
@@ -43,7 +43,7 @@ AutoGunzipReader::Detect()
}
if
(
IsGzip
(
data
))
next
=
gunzip
=
new
GunzipReader
(
peek
);
next
=
(
gunzip
=
std
::
make_unique
<
GunzipReader
>
(
peek
)).
get
(
);
else
next
=
&
peek
;
}
...
...
src/fs/io/AutoGunzipReader.hxx
View file @
1cfc0cb8
...
...
@@ -21,7 +21,8 @@
#define MPD_AUTO_GUNZIP_READER_HXX
#include "PeekReader.hxx"
#include "util/Compiler.h"
#include <memory>
class
GunzipReader
;
...
...
@@ -32,11 +33,10 @@ class GunzipReader;
class
AutoGunzipReader
final
:
public
Reader
{
Reader
*
next
=
nullptr
;
PeekReader
peek
;
GunzipReader
*
gunzip
=
nullptr
;
std
::
unique_ptr
<
GunzipReader
>
gunzip
;
public
:
explicit
AutoGunzipReader
(
Reader
&
_next
)
noexcept
:
peek
(
_next
)
{}
explicit
AutoGunzipReader
(
Reader
&
_next
)
noexcept
;
~
AutoGunzipReader
()
noexcept
;
/* virtual methods from class Reader */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment