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
8681a3d7
Commit
8681a3d7
authored
Dec 03, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace TextFile references with LineReader
parent
f9c4d88b
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
33 additions
and
31 deletions
+33
-31
PlaylistDatabase.cxx
src/PlaylistDatabase.cxx
+2
-2
PlaylistDatabase.hxx
src/PlaylistDatabase.hxx
+3
-2
SongSave.cxx
src/SongSave.cxx
+2
-2
SongSave.hxx
src/SongSave.hxx
+2
-2
DatabaseSave.cxx
src/db/plugins/simple/DatabaseSave.cxx
+2
-2
DatabaseSave.hxx
src/db/plugins/simple/DatabaseSave.hxx
+2
-2
DirectorySave.cxx
src/db/plugins/simple/DirectorySave.cxx
+3
-3
DirectorySave.hxx
src/db/plugins/simple/DirectorySave.hxx
+2
-2
PlaylistState.cxx
src/queue/PlaylistState.cxx
+3
-3
PlaylistState.hxx
src/queue/PlaylistState.hxx
+2
-2
QueueSave.cxx
src/queue/QueueSave.cxx
+3
-3
QueueSave.hxx
src/queue/QueueSave.hxx
+2
-2
StorageState.cxx
src/storage/StorageState.cxx
+2
-2
StorageState.hxx
src/storage/StorageState.hxx
+3
-2
No files found.
src/PlaylistDatabase.cxx
View file @
8681a3d7
...
...
@@ -19,7 +19,7 @@
#include "PlaylistDatabase.hxx"
#include "db/PlaylistVector.hxx"
#include "fs/io/
TextFile
.hxx"
#include "fs/io/
LineReader
.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "time/ChronoUtil.hxx"
#include "util/StringStrip.hxx"
...
...
@@ -42,7 +42,7 @@ playlist_vector_save(BufferedOutputStream &os, const PlaylistVector &pv)
}
void
playlist_metadata_load
(
TextFile
&
file
,
PlaylistVector
&
pv
,
const
char
*
name
)
playlist_metadata_load
(
LineReader
&
file
,
PlaylistVector
&
pv
,
const
char
*
name
)
{
PlaylistInfo
pm
(
name
);
...
...
src/PlaylistDatabase.hxx
View file @
8681a3d7
...
...
@@ -24,7 +24,7 @@
class
PlaylistVector
;
class
BufferedOutputStream
;
class
TextFile
;
class
LineReader
;
void
playlist_vector_save
(
BufferedOutputStream
&
os
,
const
PlaylistVector
&
pv
);
...
...
@@ -33,6 +33,7 @@ playlist_vector_save(BufferedOutputStream &os, const PlaylistVector &pv);
* Throws #std::runtime_error on error.
*/
void
playlist_metadata_load
(
TextFile
&
file
,
PlaylistVector
&
pv
,
const
char
*
name
);
playlist_metadata_load
(
LineReader
&
file
,
PlaylistVector
&
pv
,
const
char
*
name
);
#endif
src/SongSave.cxx
View file @
8681a3d7
...
...
@@ -22,7 +22,7 @@
#include "db/plugins/simple/Song.hxx"
#include "song/DetachedSong.hxx"
#include "TagSave.hxx"
#include "fs/io/
TextFile
.hxx"
#include "fs/io/
LineReader
.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "tag/ParseName.hxx"
#include "tag/Tag.hxx"
...
...
@@ -85,7 +85,7 @@ song_save(BufferedOutputStream &os, const DetachedSong &song)
}
DetachedSong
song_load
(
TextFile
&
file
,
const
char
*
uri
,
song_load
(
LineReader
&
file
,
const
char
*
uri
,
std
::
string
*
target_r
)
{
DetachedSong
song
(
uri
);
...
...
src/SongSave.hxx
View file @
8681a3d7
...
...
@@ -28,7 +28,7 @@ struct Song;
struct
AudioFormat
;
class
DetachedSong
;
class
BufferedOutputStream
;
class
TextFile
;
class
LineReader
;
void
song_save
(
BufferedOutputStream
&
os
,
const
Song
&
song
);
...
...
@@ -43,7 +43,7 @@ song_save(BufferedOutputStream &os, const DetachedSong &song);
* Throws on error.
*/
DetachedSong
song_load
(
TextFile
&
file
,
const
char
*
uri
,
song_load
(
LineReader
&
file
,
const
char
*
uri
,
std
::
string
*
target_r
=
nullptr
);
#endif
src/db/plugins/simple/DatabaseSave.cxx
View file @
8681a3d7
...
...
@@ -21,7 +21,7 @@
#include "db/DatabaseLock.hxx"
#include "DirectorySave.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "fs/io/
TextFile
.hxx"
#include "fs/io/
LineReader
.hxx"
#include "tag/ParseName.hxx"
#include "tag/Settings.hxx"
#include "fs/Charset.hxx"
...
...
@@ -64,7 +64,7 @@ db_save_internal(BufferedOutputStream &os, const Directory &music_root)
}
void
db_load_internal
(
TextFile
&
file
,
Directory
&
music_root
)
db_load_internal
(
LineReader
&
file
,
Directory
&
music_root
)
{
char
*
line
;
unsigned
format
=
0
;
...
...
src/db/plugins/simple/DatabaseSave.hxx
View file @
8681a3d7
...
...
@@ -22,7 +22,7 @@
struct
Directory
;
class
BufferedOutputStream
;
class
TextFile
;
class
LineReader
;
void
db_save_internal
(
BufferedOutputStream
&
os
,
const
Directory
&
root
);
...
...
@@ -31,6 +31,6 @@ db_save_internal(BufferedOutputStream &os, const Directory &root);
* Throws #std::runtime_error on error.
*/
void
db_load_internal
(
TextFile
&
file
,
Directory
&
root
);
db_load_internal
(
LineReader
&
file
,
Directory
&
root
);
#endif
src/db/plugins/simple/DirectorySave.cxx
View file @
8681a3d7
...
...
@@ -23,7 +23,7 @@
#include "SongSave.hxx"
#include "song/DetachedSong.hxx"
#include "PlaylistDatabase.hxx"
#include "fs/io/
TextFile
.hxx"
#include "fs/io/
LineReader
.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "time/ChronoUtil.hxx"
#include "util/StringAPI.hxx"
...
...
@@ -121,7 +121,7 @@ ParseLine(Directory &directory, const char *line)
}
static
Directory
*
directory_load_subdir
(
TextFile
&
file
,
Directory
&
parent
,
std
::
string_view
name
)
directory_load_subdir
(
LineReader
&
file
,
Directory
&
parent
,
std
::
string_view
name
)
{
if
(
parent
.
FindChild
(
name
)
!=
nullptr
)
throw
FormatRuntimeError
(
"Duplicate subdirectory '%.*s'"
,
...
...
@@ -152,7 +152,7 @@ directory_load_subdir(TextFile &file, Directory &parent, std::string_view name)
}
void
directory_load
(
TextFile
&
file
,
Directory
&
directory
)
directory_load
(
LineReader
&
file
,
Directory
&
directory
)
{
const
char
*
line
;
...
...
src/db/plugins/simple/DirectorySave.hxx
View file @
8681a3d7
...
...
@@ -21,7 +21,7 @@
#define MPD_DIRECTORY_SAVE_HXX
struct
Directory
;
class
TextFile
;
class
LineReader
;
class
BufferedOutputStream
;
void
...
...
@@ -31,6 +31,6 @@ directory_save(BufferedOutputStream &os, const Directory &directory);
* Throws #std::runtime_error on error.
*/
void
directory_load
(
TextFile
&
file
,
Directory
&
directory
);
directory_load
(
LineReader
&
file
,
Directory
&
directory
);
#endif
src/queue/PlaylistState.cxx
View file @
8681a3d7
...
...
@@ -28,7 +28,7 @@
#include "SingleMode.hxx"
#include "StateFileConfig.hxx"
#include "queue/QueueSave.hxx"
#include "fs/io/
TextFile
.hxx"
#include "fs/io/
LineReader
.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "player/Control.hxx"
#include "util/CharUtil.hxx"
...
...
@@ -102,7 +102,7 @@ playlist_state_save(BufferedOutputStream &os, const struct playlist &playlist,
}
static
void
playlist_state_load
(
TextFile
&
file
,
const
SongLoader
&
song_loader
,
playlist_state_load
(
LineReader
&
file
,
const
SongLoader
&
song_loader
,
struct
playlist
&
playlist
)
{
const
char
*
line
=
file
.
ReadLine
();
...
...
@@ -128,7 +128,7 @@ playlist_state_load(TextFile &file, const SongLoader &song_loader,
bool
playlist_state_restore
(
const
StateFileConfig
&
config
,
const
char
*
line
,
TextFile
&
file
,
const
char
*
line
,
LineReader
&
file
,
const
SongLoader
&
song_loader
,
struct
playlist
&
playlist
,
PlayerControl
&
pc
)
{
...
...
src/queue/PlaylistState.hxx
View file @
8681a3d7
...
...
@@ -28,7 +28,7 @@
struct
StateFileConfig
;
struct
playlist
;
class
PlayerControl
;
class
TextFile
;
class
LineReader
;
class
BufferedOutputStream
;
class
SongLoader
;
...
...
@@ -38,7 +38,7 @@ playlist_state_save(BufferedOutputStream &os, const playlist &playlist,
bool
playlist_state_restore
(
const
StateFileConfig
&
config
,
const
char
*
line
,
TextFile
&
file
,
const
char
*
line
,
LineReader
&
file
,
const
SongLoader
&
song_loader
,
playlist
&
playlist
,
PlayerControl
&
pc
);
...
...
src/queue/QueueSave.cxx
View file @
8681a3d7
...
...
@@ -23,7 +23,7 @@
#include "song/DetachedSong.hxx"
#include "SongSave.hxx"
#include "playlist/PlaylistSong.hxx"
#include "fs/io/
TextFile
.hxx"
#include "fs/io/
LineReader
.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "util/StringCompare.hxx"
#include "Log.hxx"
...
...
@@ -74,7 +74,7 @@ queue_save(BufferedOutputStream &os, const Queue &queue)
}
static
DetachedSong
LoadQueueSong
(
TextFile
&
file
,
const
char
*
line
)
LoadQueueSong
(
LineReader
&
file
,
const
char
*
line
)
{
std
::
unique_ptr
<
DetachedSong
>
song
;
...
...
@@ -94,7 +94,7 @@ LoadQueueSong(TextFile &file, const char *line)
}
void
queue_load_song
(
TextFile
&
file
,
const
SongLoader
&
loader
,
queue_load_song
(
LineReader
&
file
,
const
SongLoader
&
loader
,
const
char
*
line
,
Queue
&
queue
)
{
if
(
queue
.
IsFull
())
...
...
src/queue/QueueSave.hxx
View file @
8681a3d7
...
...
@@ -27,7 +27,7 @@
struct
Queue
;
class
BufferedOutputStream
;
class
TextFile
;
class
LineReader
;
class
SongLoader
;
void
...
...
@@ -39,7 +39,7 @@ queue_save(BufferedOutputStream &os, const Queue &queue);
* Throws on error.
*/
void
queue_load_song
(
TextFile
&
file
,
const
SongLoader
&
loader
,
queue_load_song
(
LineReader
&
file
,
const
SongLoader
&
loader
,
const
char
*
line
,
Queue
&
queue
);
#endif
src/storage/StorageState.cxx
View file @
8681a3d7
...
...
@@ -24,7 +24,7 @@
#include "StorageState.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "fs/io/
TextFile
.hxx"
#include "fs/io/
LineReader
.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "storage/Registry.hxx"
#include "storage/CompositeStorage.hxx"
...
...
@@ -73,7 +73,7 @@ storage_state_save(BufferedOutputStream &os, const Instance &instance)
}
bool
storage_state_restore
(
const
char
*
line
,
TextFile
&
file
,
Instance
&
instance
)
storage_state_restore
(
const
char
*
line
,
LineReader
&
file
,
Instance
&
instance
)
{
if
(
!
StringStartsWith
(
line
,
MOUNT_STATE_BEGIN
))
return
false
;
...
...
src/storage/StorageState.hxx
View file @
8681a3d7
...
...
@@ -27,13 +27,14 @@
struct
Instance
;
class
BufferedOutputStream
;
class
TextFile
;
class
LineReader
;
void
storage_state_save
(
BufferedOutputStream
&
os
,
const
Instance
&
instance
);
bool
storage_state_restore
(
const
char
*
line
,
TextFile
&
file
,
Instance
&
instance
);
storage_state_restore
(
const
char
*
line
,
LineReader
&
file
,
Instance
&
instance
);
/**
* Generates a hash number for the current state of the composite storage.
...
...
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