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
Show 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 @@
...
@@ -19,7 +19,7 @@
#include "PlaylistDatabase.hxx"
#include "PlaylistDatabase.hxx"
#include "db/PlaylistVector.hxx"
#include "db/PlaylistVector.hxx"
#include "fs/io/
TextFile
.hxx"
#include "fs/io/
LineReader
.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "time/ChronoUtil.hxx"
#include "time/ChronoUtil.hxx"
#include "util/StringStrip.hxx"
#include "util/StringStrip.hxx"
...
@@ -42,7 +42,7 @@ playlist_vector_save(BufferedOutputStream &os, const PlaylistVector &pv)
...
@@ -42,7 +42,7 @@ playlist_vector_save(BufferedOutputStream &os, const PlaylistVector &pv)
}
}
void
void
playlist_metadata_load
(
TextFile
&
file
,
PlaylistVector
&
pv
,
const
char
*
name
)
playlist_metadata_load
(
LineReader
&
file
,
PlaylistVector
&
pv
,
const
char
*
name
)
{
{
PlaylistInfo
pm
(
name
);
PlaylistInfo
pm
(
name
);
...
...
src/PlaylistDatabase.hxx
View file @
8681a3d7
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
class
PlaylistVector
;
class
PlaylistVector
;
class
BufferedOutputStream
;
class
BufferedOutputStream
;
class
TextFile
;
class
LineReader
;
void
void
playlist_vector_save
(
BufferedOutputStream
&
os
,
const
PlaylistVector
&
pv
);
playlist_vector_save
(
BufferedOutputStream
&
os
,
const
PlaylistVector
&
pv
);
...
@@ -33,6 +33,7 @@ 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.
* Throws #std::runtime_error on error.
*/
*/
void
void
playlist_metadata_load
(
TextFile
&
file
,
PlaylistVector
&
pv
,
const
char
*
name
);
playlist_metadata_load
(
LineReader
&
file
,
PlaylistVector
&
pv
,
const
char
*
name
);
#endif
#endif
src/SongSave.cxx
View file @
8681a3d7
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
#include "db/plugins/simple/Song.hxx"
#include "db/plugins/simple/Song.hxx"
#include "song/DetachedSong.hxx"
#include "song/DetachedSong.hxx"
#include "TagSave.hxx"
#include "TagSave.hxx"
#include "fs/io/
TextFile
.hxx"
#include "fs/io/
LineReader
.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "tag/ParseName.hxx"
#include "tag/ParseName.hxx"
#include "tag/Tag.hxx"
#include "tag/Tag.hxx"
...
@@ -85,7 +85,7 @@ song_save(BufferedOutputStream &os, const DetachedSong &song)
...
@@ -85,7 +85,7 @@ song_save(BufferedOutputStream &os, const DetachedSong &song)
}
}
DetachedSong
DetachedSong
song_load
(
TextFile
&
file
,
const
char
*
uri
,
song_load
(
LineReader
&
file
,
const
char
*
uri
,
std
::
string
*
target_r
)
std
::
string
*
target_r
)
{
{
DetachedSong
song
(
uri
);
DetachedSong
song
(
uri
);
...
...
src/SongSave.hxx
View file @
8681a3d7
...
@@ -28,7 +28,7 @@ struct Song;
...
@@ -28,7 +28,7 @@ struct Song;
struct
AudioFormat
;
struct
AudioFormat
;
class
DetachedSong
;
class
DetachedSong
;
class
BufferedOutputStream
;
class
BufferedOutputStream
;
class
TextFile
;
class
LineReader
;
void
void
song_save
(
BufferedOutputStream
&
os
,
const
Song
&
song
);
song_save
(
BufferedOutputStream
&
os
,
const
Song
&
song
);
...
@@ -43,7 +43,7 @@ song_save(BufferedOutputStream &os, const DetachedSong &song);
...
@@ -43,7 +43,7 @@ song_save(BufferedOutputStream &os, const DetachedSong &song);
* Throws on error.
* Throws on error.
*/
*/
DetachedSong
DetachedSong
song_load
(
TextFile
&
file
,
const
char
*
uri
,
song_load
(
LineReader
&
file
,
const
char
*
uri
,
std
::
string
*
target_r
=
nullptr
);
std
::
string
*
target_r
=
nullptr
);
#endif
#endif
src/db/plugins/simple/DatabaseSave.cxx
View file @
8681a3d7
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
#include "db/DatabaseLock.hxx"
#include "db/DatabaseLock.hxx"
#include "DirectorySave.hxx"
#include "DirectorySave.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "fs/io/
TextFile
.hxx"
#include "fs/io/
LineReader
.hxx"
#include "tag/ParseName.hxx"
#include "tag/ParseName.hxx"
#include "tag/Settings.hxx"
#include "tag/Settings.hxx"
#include "fs/Charset.hxx"
#include "fs/Charset.hxx"
...
@@ -64,7 +64,7 @@ db_save_internal(BufferedOutputStream &os, const Directory &music_root)
...
@@ -64,7 +64,7 @@ db_save_internal(BufferedOutputStream &os, const Directory &music_root)
}
}
void
void
db_load_internal
(
TextFile
&
file
,
Directory
&
music_root
)
db_load_internal
(
LineReader
&
file
,
Directory
&
music_root
)
{
{
char
*
line
;
char
*
line
;
unsigned
format
=
0
;
unsigned
format
=
0
;
...
...
src/db/plugins/simple/DatabaseSave.hxx
View file @
8681a3d7
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
struct
Directory
;
struct
Directory
;
class
BufferedOutputStream
;
class
BufferedOutputStream
;
class
TextFile
;
class
LineReader
;
void
void
db_save_internal
(
BufferedOutputStream
&
os
,
const
Directory
&
root
);
db_save_internal
(
BufferedOutputStream
&
os
,
const
Directory
&
root
);
...
@@ -31,6 +31,6 @@ 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.
* Throws #std::runtime_error on error.
*/
*/
void
void
db_load_internal
(
TextFile
&
file
,
Directory
&
root
);
db_load_internal
(
LineReader
&
file
,
Directory
&
root
);
#endif
#endif
src/db/plugins/simple/DirectorySave.cxx
View file @
8681a3d7
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
#include "SongSave.hxx"
#include "SongSave.hxx"
#include "song/DetachedSong.hxx"
#include "song/DetachedSong.hxx"
#include "PlaylistDatabase.hxx"
#include "PlaylistDatabase.hxx"
#include "fs/io/
TextFile
.hxx"
#include "fs/io/
LineReader
.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "time/ChronoUtil.hxx"
#include "time/ChronoUtil.hxx"
#include "util/StringAPI.hxx"
#include "util/StringAPI.hxx"
...
@@ -121,7 +121,7 @@ ParseLine(Directory &directory, const char *line)
...
@@ -121,7 +121,7 @@ ParseLine(Directory &directory, const char *line)
}
}
static
Directory
*
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
)
if
(
parent
.
FindChild
(
name
)
!=
nullptr
)
throw
FormatRuntimeError
(
"Duplicate subdirectory '%.*s'"
,
throw
FormatRuntimeError
(
"Duplicate subdirectory '%.*s'"
,
...
@@ -152,7 +152,7 @@ directory_load_subdir(TextFile &file, Directory &parent, std::string_view name)
...
@@ -152,7 +152,7 @@ directory_load_subdir(TextFile &file, Directory &parent, std::string_view name)
}
}
void
void
directory_load
(
TextFile
&
file
,
Directory
&
directory
)
directory_load
(
LineReader
&
file
,
Directory
&
directory
)
{
{
const
char
*
line
;
const
char
*
line
;
...
...
src/db/plugins/simple/DirectorySave.hxx
View file @
8681a3d7
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
#define MPD_DIRECTORY_SAVE_HXX
#define MPD_DIRECTORY_SAVE_HXX
struct
Directory
;
struct
Directory
;
class
TextFile
;
class
LineReader
;
class
BufferedOutputStream
;
class
BufferedOutputStream
;
void
void
...
@@ -31,6 +31,6 @@ directory_save(BufferedOutputStream &os, const Directory &directory);
...
@@ -31,6 +31,6 @@ directory_save(BufferedOutputStream &os, const Directory &directory);
* Throws #std::runtime_error on error.
* Throws #std::runtime_error on error.
*/
*/
void
void
directory_load
(
TextFile
&
file
,
Directory
&
directory
);
directory_load
(
LineReader
&
file
,
Directory
&
directory
);
#endif
#endif
src/queue/PlaylistState.cxx
View file @
8681a3d7
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
#include "SingleMode.hxx"
#include "SingleMode.hxx"
#include "StateFileConfig.hxx"
#include "StateFileConfig.hxx"
#include "queue/QueueSave.hxx"
#include "queue/QueueSave.hxx"
#include "fs/io/
TextFile
.hxx"
#include "fs/io/
LineReader
.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "player/Control.hxx"
#include "player/Control.hxx"
#include "util/CharUtil.hxx"
#include "util/CharUtil.hxx"
...
@@ -102,7 +102,7 @@ playlist_state_save(BufferedOutputStream &os, const struct playlist &playlist,
...
@@ -102,7 +102,7 @@ playlist_state_save(BufferedOutputStream &os, const struct playlist &playlist,
}
}
static
void
static
void
playlist_state_load
(
TextFile
&
file
,
const
SongLoader
&
song_loader
,
playlist_state_load
(
LineReader
&
file
,
const
SongLoader
&
song_loader
,
struct
playlist
&
playlist
)
struct
playlist
&
playlist
)
{
{
const
char
*
line
=
file
.
ReadLine
();
const
char
*
line
=
file
.
ReadLine
();
...
@@ -128,7 +128,7 @@ playlist_state_load(TextFile &file, const SongLoader &song_loader,
...
@@ -128,7 +128,7 @@ playlist_state_load(TextFile &file, const SongLoader &song_loader,
bool
bool
playlist_state_restore
(
const
StateFileConfig
&
config
,
playlist_state_restore
(
const
StateFileConfig
&
config
,
const
char
*
line
,
TextFile
&
file
,
const
char
*
line
,
LineReader
&
file
,
const
SongLoader
&
song_loader
,
const
SongLoader
&
song_loader
,
struct
playlist
&
playlist
,
PlayerControl
&
pc
)
struct
playlist
&
playlist
,
PlayerControl
&
pc
)
{
{
...
...
src/queue/PlaylistState.hxx
View file @
8681a3d7
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
struct
StateFileConfig
;
struct
StateFileConfig
;
struct
playlist
;
struct
playlist
;
class
PlayerControl
;
class
PlayerControl
;
class
TextFile
;
class
LineReader
;
class
BufferedOutputStream
;
class
BufferedOutputStream
;
class
SongLoader
;
class
SongLoader
;
...
@@ -38,7 +38,7 @@ playlist_state_save(BufferedOutputStream &os, const playlist &playlist,
...
@@ -38,7 +38,7 @@ playlist_state_save(BufferedOutputStream &os, const playlist &playlist,
bool
bool
playlist_state_restore
(
const
StateFileConfig
&
config
,
playlist_state_restore
(
const
StateFileConfig
&
config
,
const
char
*
line
,
TextFile
&
file
,
const
char
*
line
,
LineReader
&
file
,
const
SongLoader
&
song_loader
,
const
SongLoader
&
song_loader
,
playlist
&
playlist
,
PlayerControl
&
pc
);
playlist
&
playlist
,
PlayerControl
&
pc
);
...
...
src/queue/QueueSave.cxx
View file @
8681a3d7
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
#include "song/DetachedSong.hxx"
#include "song/DetachedSong.hxx"
#include "SongSave.hxx"
#include "SongSave.hxx"
#include "playlist/PlaylistSong.hxx"
#include "playlist/PlaylistSong.hxx"
#include "fs/io/
TextFile
.hxx"
#include "fs/io/
LineReader
.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "util/StringCompare.hxx"
#include "util/StringCompare.hxx"
#include "Log.hxx"
#include "Log.hxx"
...
@@ -74,7 +74,7 @@ queue_save(BufferedOutputStream &os, const Queue &queue)
...
@@ -74,7 +74,7 @@ queue_save(BufferedOutputStream &os, const Queue &queue)
}
}
static
DetachedSong
static
DetachedSong
LoadQueueSong
(
TextFile
&
file
,
const
char
*
line
)
LoadQueueSong
(
LineReader
&
file
,
const
char
*
line
)
{
{
std
::
unique_ptr
<
DetachedSong
>
song
;
std
::
unique_ptr
<
DetachedSong
>
song
;
...
@@ -94,7 +94,7 @@ LoadQueueSong(TextFile &file, const char *line)
...
@@ -94,7 +94,7 @@ LoadQueueSong(TextFile &file, const char *line)
}
}
void
void
queue_load_song
(
TextFile
&
file
,
const
SongLoader
&
loader
,
queue_load_song
(
LineReader
&
file
,
const
SongLoader
&
loader
,
const
char
*
line
,
Queue
&
queue
)
const
char
*
line
,
Queue
&
queue
)
{
{
if
(
queue
.
IsFull
())
if
(
queue
.
IsFull
())
...
...
src/queue/QueueSave.hxx
View file @
8681a3d7
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
struct
Queue
;
struct
Queue
;
class
BufferedOutputStream
;
class
BufferedOutputStream
;
class
TextFile
;
class
LineReader
;
class
SongLoader
;
class
SongLoader
;
void
void
...
@@ -39,7 +39,7 @@ queue_save(BufferedOutputStream &os, const Queue &queue);
...
@@ -39,7 +39,7 @@ queue_save(BufferedOutputStream &os, const Queue &queue);
* Throws on error.
* Throws on error.
*/
*/
void
void
queue_load_song
(
TextFile
&
file
,
const
SongLoader
&
loader
,
queue_load_song
(
LineReader
&
file
,
const
SongLoader
&
loader
,
const
char
*
line
,
Queue
&
queue
);
const
char
*
line
,
Queue
&
queue
);
#endif
#endif
src/storage/StorageState.cxx
View file @
8681a3d7
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
#include "StorageState.hxx"
#include "StorageState.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "fs/io/
TextFile
.hxx"
#include "fs/io/
LineReader
.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "storage/Registry.hxx"
#include "storage/Registry.hxx"
#include "storage/CompositeStorage.hxx"
#include "storage/CompositeStorage.hxx"
...
@@ -73,7 +73,7 @@ storage_state_save(BufferedOutputStream &os, const Instance &instance)
...
@@ -73,7 +73,7 @@ storage_state_save(BufferedOutputStream &os, const Instance &instance)
}
}
bool
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
))
if
(
!
StringStartsWith
(
line
,
MOUNT_STATE_BEGIN
))
return
false
;
return
false
;
...
...
src/storage/StorageState.hxx
View file @
8681a3d7
...
@@ -27,13 +27,14 @@
...
@@ -27,13 +27,14 @@
struct
Instance
;
struct
Instance
;
class
BufferedOutputStream
;
class
BufferedOutputStream
;
class
TextFile
;
class
LineReader
;
void
void
storage_state_save
(
BufferedOutputStream
&
os
,
const
Instance
&
instance
);
storage_state_save
(
BufferedOutputStream
&
os
,
const
Instance
&
instance
);
bool
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.
* 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