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
eaf0662b
Commit
eaf0662b
authored
Jan 14, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/io/FileOutputStream: add static method Create()
parent
6e8ea2a2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
FileOutputStream.cxx
src/fs/io/FileOutputStream.cxx
+12
-0
FileOutputStream.hxx
src/fs/io/FileOutputStream.hxx
+1
-0
RecorderOutputPlugin.cxx
src/output/plugins/RecorderOutputPlugin.cxx
+2
-4
No files found.
src/fs/io/FileOutputStream.cxx
View file @
eaf0662b
...
...
@@ -22,6 +22,18 @@
#include "fs/FileSystem.hxx"
#include "util/Error.hxx"
FileOutputStream
*
FileOutputStream
::
Create
(
Path
path
,
Error
&
error
)
{
FileOutputStream
*
f
=
new
FileOutputStream
(
path
,
error
);
if
(
!
f
->
IsDefined
())
{
delete
f
;
f
=
nullptr
;
}
return
f
;
}
#ifdef WIN32
FileOutputStream
::
FileOutputStream
(
Path
_path
,
Error
&
error
)
...
...
src/fs/io/FileOutputStream.hxx
View file @
eaf0662b
...
...
@@ -58,6 +58,7 @@ public:
Cancel
();
}
static
FileOutputStream
*
Create
(
Path
path
,
Error
&
error
);
bool
IsDefined
()
const
{
#ifdef WIN32
...
...
src/output/plugins/RecorderOutputPlugin.cxx
View file @
eaf0662b
...
...
@@ -167,11 +167,9 @@ RecorderOutput::Open(AudioFormat &audio_format, Error &error)
{
/* create the output file */
file
=
new
FileOutputStream
(
path
,
error
);
if
(
!
file
->
IsDefined
())
{
delete
file
;
file
=
FileOutputStream
::
Create
(
path
,
error
);
if
(
file
==
nullptr
)
return
false
;
}
/* open the encoder */
...
...
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