aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Makefile.am1
-rw-r--r--src/command/AllCommands.cxx17
-rw-r--r--src/command/DatabaseCommands.cxx25
-rw-r--r--src/command/DatabaseCommands.hxx22
-rw-r--r--src/command/FileCommands.cxx3
-rw-r--r--src/command/FileCommands.hxx4
-rw-r--r--src/command/MessageCommands.cxx11
-rw-r--r--src/command/MessageCommands.hxx12
-rw-r--r--src/command/NeighborCommands.cxx3
-rw-r--r--src/command/NeighborCommands.hxx4
-rw-r--r--src/command/OtherCommands.cxx35
-rw-r--r--src/command/OtherCommands.hxx34
-rw-r--r--src/command/OutputCommands.cxx9
-rw-r--r--src/command/OutputCommands.hxx10
-rw-r--r--src/command/PlayerCommands.cxx43
-rw-r--r--src/command/PlayerCommands.hxx44
-rw-r--r--src/command/PlaylistCommands.cxx23
-rw-r--r--src/command/PlaylistCommands.hxx24
-rw-r--r--src/command/QueueCommands.cxx43
-rw-r--r--src/command/QueueCommands.hxx42
-rw-r--r--src/command/Request.hxx34
-rw-r--r--src/command/StickerCommands.cxx5
-rw-r--r--src/command/StickerCommands.hxx4
-rw-r--r--src/command/StorageCommands.cxx7
-rw-r--r--src/command/StorageCommands.hxx8
-rw-r--r--src/command/TagCommands.cxx5
-rw-r--r--src/command/TagCommands.hxx6
27 files changed, 263 insertions, 215 deletions
diff --git a/Makefile.am b/Makefile.am
index 842ed1efa..1889d26dd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -81,6 +81,7 @@ libmpd_a_SOURCES = \
src/protocol/Ack.cxx src/protocol/Ack.hxx \
src/protocol/ArgParser.cxx src/protocol/ArgParser.hxx \
src/protocol/Result.cxx src/protocol/Result.hxx \
+ src/command/Request.hxx \
src/command/CommandResult.hxx \
src/command/CommandError.cxx src/command/CommandError.hxx \
src/command/AllCommands.cxx src/command/AllCommands.hxx \
diff --git a/src/command/AllCommands.cxx b/src/command/AllCommands.cxx
index bd232efda..9f0b0a606 100644
--- a/src/command/AllCommands.cxx
+++ b/src/command/AllCommands.cxx
@@ -19,6 +19,7 @@
#include "config.h"
#include "AllCommands.hxx"
+#include "Request.hxx"
#include "QueueCommands.hxx"
#include "TagCommands.hxx"
#include "PlayerCommands.hxx"
@@ -62,15 +63,15 @@ struct command {
unsigned permission;
int min;
int max;
- CommandResult (*handler)(Client &client, ConstBuffer<const char *> args);
+ CommandResult (*handler)(Client &client, Request args);
};
/* don't be fooled, this is the command handler for "commands" command */
static CommandResult
-handle_commands(Client &client, ConstBuffer<const char *> args);
+handle_commands(Client &client, Request args);
static CommandResult
-handle_not_commands(Client &client, ConstBuffer<const char *> args);
+handle_not_commands(Client &client, Request args);
/**
* The command registry.
@@ -227,7 +228,7 @@ command_available(gcc_unused const Partition &partition,
/* don't be fooled, this is the command handler for "commands" command */
static CommandResult
-handle_commands(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_commands(Client &client, gcc_unused Request args)
{
const unsigned permission = client.GetPermission();
@@ -243,7 +244,7 @@ handle_commands(Client &client, gcc_unused ConstBuffer<const char *> args)
}
static CommandResult
-handle_not_commands(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_not_commands(Client &client, gcc_unused Request args)
{
const unsigned permission = client.GetPermission();
@@ -295,7 +296,7 @@ command_lookup(const char *name)
static bool
command_check_request(const struct command *cmd, Client &client,
- unsigned permission, ConstBuffer<const char *> args)
+ unsigned permission, Request args)
{
if (cmd->permission != (permission & cmd->permission)) {
command_error(client, ACK_ERROR_PERMISSION,
@@ -329,7 +330,7 @@ command_check_request(const struct command *cmd, Client &client,
static const struct command *
command_checked_lookup(Client &client, unsigned permission,
- const char *cmd_name, ConstBuffer<const char *> args)
+ const char *cmd_name, Request args)
{
current_command = "";
@@ -380,7 +381,7 @@ command_process(Client &client, unsigned num, char *line)
}
char *argv[COMMAND_ARGV_MAX];
- ConstBuffer<const char *> args(argv, 0);
+ Request args(argv, 0);
/* now parse the arguments (quoted or unquoted) */
diff --git a/src/command/DatabaseCommands.cxx b/src/command/DatabaseCommands.cxx
index 8999fb1ea..99a200848 100644
--- a/src/command/DatabaseCommands.cxx
+++ b/src/command/DatabaseCommands.cxx
@@ -19,6 +19,7 @@
#include "config.h"
#include "DatabaseCommands.hxx"
+#include "Request.hxx"
#include "db/DatabaseGlue.hxx"
#include "db/DatabaseQueue.hxx"
#include "db/DatabasePlaylist.hxx"
@@ -50,7 +51,7 @@ handle_listfiles_db(Client &client, const char *uri)
}
CommandResult
-handle_lsinfo2(Client &client, ConstBuffer<const char *> args)
+handle_lsinfo2(Client &client, Request args)
{
/* default is root directory */
const char *const uri = args.IsEmpty() ? "" : args.front();
@@ -65,7 +66,7 @@ handle_lsinfo2(Client &client, ConstBuffer<const char *> args)
}
static CommandResult
-handle_match(Client &client, ConstBuffer<const char *> args, bool fold_case)
+handle_match(Client &client, Request args, bool fold_case)
{
RangeArg window;
if (args.size >= 2 && strcmp(args[args.size - 2], "window") == 0) {
@@ -93,19 +94,19 @@ handle_match(Client &client, ConstBuffer<const char *> args, bool fold_case)
}
CommandResult
-handle_find(Client &client, ConstBuffer<const char *> args)
+handle_find(Client &client, Request args)
{
return handle_match(client, args, false);
}
CommandResult
-handle_search(Client &client, ConstBuffer<const char *> args)
+handle_search(Client &client, Request args)
{
return handle_match(client, args, true);
}
static CommandResult
-handle_match_add(Client &client, ConstBuffer<const char *> args, bool fold_case)
+handle_match_add(Client &client, Request args, bool fold_case)
{
SongFilter filter;
if (!filter.Parse(args, fold_case)) {
@@ -123,19 +124,19 @@ handle_match_add(Client &client, ConstBuffer<const char *> args, bool fold_case)
}
CommandResult
-handle_findadd(Client &client, ConstBuffer<const char *> args)
+handle_findadd(Client &client, Request args)
{
return handle_match_add(client, args, false);
}
CommandResult
-handle_searchadd(Client &client, ConstBuffer<const char *> args)
+handle_searchadd(Client &client, Request args)
{
return handle_match_add(client, args, true);
}
CommandResult
-handle_searchaddpl(Client &client, ConstBuffer<const char *> args)
+handle_searchaddpl(Client &client, Request args)
{
const char *playlist = args.shift();
@@ -157,7 +158,7 @@ handle_searchaddpl(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_count(Client &client, ConstBuffer<const char *> args)
+handle_count(Client &client, Request args)
{
TagType group = TAG_NUM_OF_ITEM_TYPES;
if (args.size >= 2 && strcmp(args[args.size - 2], "group") == 0) {
@@ -186,7 +187,7 @@ handle_count(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_listall(Client &client, ConstBuffer<const char *> args)
+handle_listall(Client &client, Request args)
{
/* default is root directory */
const char *const uri = args.IsEmpty() ? "" : args.front();
@@ -199,7 +200,7 @@ handle_listall(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_list(Client &client, ConstBuffer<const char *> args)
+handle_list(Client &client, Request args)
{
const char *tag_name = args.shift();
unsigned tagType = locate_parse_type(tag_name);
@@ -271,7 +272,7 @@ handle_list(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_listallinfo(Client &client, ConstBuffer<const char *> args)
+handle_listallinfo(Client &client, Request args)
{
/* default is root directory */
const char *const uri = args.IsEmpty() ? "" : args.front();
diff --git a/src/command/DatabaseCommands.hxx b/src/command/DatabaseCommands.hxx
index b731517f5..1f2cb8c6d 100644
--- a/src/command/DatabaseCommands.hxx
+++ b/src/command/DatabaseCommands.hxx
@@ -23,39 +23,39 @@
#include "CommandResult.hxx"
class Client;
-template<typename T> struct ConstBuffer;
+class Request;
CommandResult
handle_listfiles_db(Client &client, const char *uri);
CommandResult
-handle_lsinfo2(Client &client, ConstBuffer<const char *> args);
+handle_lsinfo2(Client &client, Request args);
CommandResult
-handle_find(Client &client, ConstBuffer<const char *> args);
+handle_find(Client &client, Request args);
CommandResult
-handle_findadd(Client &client, ConstBuffer<const char *> args);
+handle_findadd(Client &client, Request args);
CommandResult
-handle_search(Client &client, ConstBuffer<const char *> args);
+handle_search(Client &client, Request args);
CommandResult
-handle_searchadd(Client &client, ConstBuffer<const char *> args);
+handle_searchadd(Client &client, Request args);
CommandResult
-handle_searchaddpl(Client &client, ConstBuffer<const char *> args);
+handle_searchaddpl(Client &client, Request args);
CommandResult
-handle_count(Client &client, ConstBuffer<const char *> args);
+handle_count(Client &client, Request args);
CommandResult
-handle_listall(Client &client, ConstBuffer<const char *> args);
+handle_listall(Client &client, Request args);
CommandResult
-handle_list(Client &client, ConstBuffer<const char *> args);
+handle_list(Client &client, Request args);
CommandResult
-handle_listallinfo(Client &client, ConstBuffer<const char *> args);
+handle_listallinfo(Client &client, Request args);
#endif
diff --git a/src/command/FileCommands.cxx b/src/command/FileCommands.cxx
index 7673c0a2e..574254d7a 100644
--- a/src/command/FileCommands.cxx
+++ b/src/command/FileCommands.cxx
@@ -21,6 +21,7 @@
#include "config.h"
#include "FileCommands.hxx"
+#include "Request.hxx"
#include "CommandError.hxx"
#include "protocol/Ack.hxx"
#include "protocol/Result.hxx"
@@ -216,7 +217,7 @@ translate_uri(const char *uri)
}
CommandResult
-handle_read_comments(Client &client, ConstBuffer<const char *> args)
+handle_read_comments(Client &client, Request args)
{
assert(args.size == 1);
const char *const uri = translate_uri(args.front());
diff --git a/src/command/FileCommands.hxx b/src/command/FileCommands.hxx
index b5bc7b8b2..9812fd362 100644
--- a/src/command/FileCommands.hxx
+++ b/src/command/FileCommands.hxx
@@ -23,12 +23,12 @@
#include "CommandResult.hxx"
class Client;
-template<typename T> struct ConstBuffer;
+class Request;
CommandResult
handle_listfiles_local(Client &client, const char *path_utf8);
CommandResult
-handle_read_comments(Client &client, ConstBuffer<const char *> args);
+handle_read_comments(Client &client, Request args);
#endif
diff --git a/src/command/MessageCommands.cxx b/src/command/MessageCommands.cxx
index 9f8f3d1d4..24c9ddf2d 100644
--- a/src/command/MessageCommands.cxx
+++ b/src/command/MessageCommands.cxx
@@ -19,6 +19,7 @@
#include "config.h"
#include "MessageCommands.hxx"
+#include "Request.hxx"
#include "client/Client.hxx"
#include "client/ClientList.hxx"
#include "Instance.hxx"
@@ -32,7 +33,7 @@
#include <assert.h>
CommandResult
-handle_subscribe(Client &client, ConstBuffer<const char *> args)
+handle_subscribe(Client &client, Request args)
{
assert(args.size == 1);
const char *const channel_name = args[0];
@@ -63,7 +64,7 @@ handle_subscribe(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_unsubscribe(Client &client, ConstBuffer<const char *> args)
+handle_unsubscribe(Client &client, Request args)
{
assert(args.size == 1);
const char *const channel_name = args[0];
@@ -78,7 +79,7 @@ handle_unsubscribe(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_channels(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_channels(Client &client, gcc_unused Request args)
{
assert(args.IsEmpty());
@@ -95,7 +96,7 @@ handle_channels(Client &client, gcc_unused ConstBuffer<const char *> args)
CommandResult
handle_read_messages(Client &client,
- gcc_unused ConstBuffer<const char *> args)
+ gcc_unused Request args)
{
assert(args.IsEmpty());
@@ -111,7 +112,7 @@ handle_read_messages(Client &client,
}
CommandResult
-handle_send_message(Client &client, ConstBuffer<const char *> args)
+handle_send_message(Client &client, Request args)
{
assert(args.size == 2);
diff --git a/src/command/MessageCommands.hxx b/src/command/MessageCommands.hxx
index 44dbfbddf..99106457b 100644
--- a/src/command/MessageCommands.hxx
+++ b/src/command/MessageCommands.hxx
@@ -23,21 +23,21 @@
#include "CommandResult.hxx"
class Client;
-template<typename T> struct ConstBuffer;
+class Request;
CommandResult
-handle_subscribe(Client &client, ConstBuffer<const char *> args);
+handle_subscribe(Client &client, Request args);
CommandResult
-handle_unsubscribe(Client &client, ConstBuffer<const char *> args);
+handle_unsubscribe(Client &client, Request args);
CommandResult
-handle_channels(Client &client, ConstBuffer<const char *> args);
+handle_channels(Client &client, Request args);
CommandResult
-handle_read_messages(Client &client, ConstBuffer<const char *> args);
+handle_read_messages(Client &client, Request args);
CommandResult
-handle_send_message(Client &client, ConstBuffer<const char *> args);
+handle_send_message(Client &client, Request args);
#endif
diff --git a/src/command/NeighborCommands.cxx b/src/command/NeighborCommands.cxx
index 3c171bddb..10dbe3074 100644
--- a/src/command/NeighborCommands.cxx
+++ b/src/command/NeighborCommands.cxx
@@ -19,6 +19,7 @@
#include "config.h"
#include "NeighborCommands.hxx"
+#include "Request.hxx"
#include "client/Client.hxx"
#include "Instance.hxx"
#include "Partition.hxx"
@@ -39,7 +40,7 @@ neighbor_commands_available(const Instance &instance)
}
CommandResult
-handle_listneighbors(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_listneighbors(Client &client, gcc_unused Request args)
{
const NeighborGlue *const neighbors =
client.partition.instance.neighbors;
diff --git a/src/command/NeighborCommands.hxx b/src/command/NeighborCommands.hxx
index c0f2a86b9..c077f5b61 100644
--- a/src/command/NeighborCommands.hxx
+++ b/src/command/NeighborCommands.hxx
@@ -25,13 +25,13 @@
struct Instance;
class Client;
-template<typename T> struct ConstBuffer;
+class Request;
gcc_pure
bool
neighbor_commands_available(const Instance &instance);
CommandResult
-handle_listneighbors(Client &client, ConstBuffer<const char *> args);
+handle_listneighbors(Client &client, Request args);
#endif
diff --git a/src/command/OtherCommands.cxx b/src/command/OtherCommands.cxx
index 6ef9b0bd7..e5696e696 100644
--- a/src/command/OtherCommands.cxx
+++ b/src/command/OtherCommands.cxx
@@ -19,6 +19,7 @@
#include "config.h"
#include "OtherCommands.hxx"
+#include "Request.hxx"
#include "FileCommands.hxx"
#include "StorageCommands.hxx"
#include "CommandError.hxx"
@@ -69,7 +70,7 @@ print_spl_list(Client &client, const PlaylistVector &list)
}
CommandResult
-handle_urlhandlers(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_urlhandlers(Client &client, gcc_unused Request args)
{
if (client.IsLocal())
client_puts(client, "handler: file://\n");
@@ -78,27 +79,27 @@ handle_urlhandlers(Client &client, gcc_unused ConstBuffer<const char *> args)
}
CommandResult
-handle_decoders(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_decoders(Client &client, gcc_unused Request args)
{
decoder_list_print(client);
return CommandResult::OK;
}
CommandResult
-handle_tagtypes(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_tagtypes(Client &client, gcc_unused Request args)
{
tag_print_types(client);
return CommandResult::OK;
}
CommandResult
-handle_kill(gcc_unused Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_kill(gcc_unused Client &client, gcc_unused Request args)
{
return CommandResult::KILL;
}
CommandResult
-handle_close(gcc_unused Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_close(gcc_unused Client &client, gcc_unused Request args)
{
return CommandResult::FINISH;
}
@@ -112,7 +113,7 @@ print_tag(TagType type, const char *value, void *ctx)
}
CommandResult
-handle_listfiles(Client &client, ConstBuffer<const char *> args)
+handle_listfiles(Client &client, Request args)
{
/* default is root directory */
const char *const uri = args.IsEmpty() ? "" : args.front();
@@ -151,7 +152,7 @@ static constexpr tag_handler print_tag_handler = {
};
CommandResult
-handle_lsinfo(Client &client, ConstBuffer<const char *> args)
+handle_lsinfo(Client &client, Request args)
{
/* default is root directory */
const char *const uri = args.IsEmpty() ? "" : args.front();
@@ -257,7 +258,7 @@ handle_update(Client &client, Database &db,
#endif
static CommandResult
-handle_update(Client &client, ConstBuffer<const char *> args, bool discard)
+handle_update(Client &client, Request args, bool discard)
{
#ifdef ENABLE_DATABASE
const char *path = "";
@@ -293,19 +294,19 @@ handle_update(Client &client, ConstBuffer<const char *> args, bool discard)
}
CommandResult
-handle_update(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_update(Client &client, gcc_unused Request args)
{
return handle_update(client, args, false);
}
CommandResult
-handle_rescan(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_rescan(Client &client, gcc_unused Request args)
{
return handle_update(client, args, true);
}
CommandResult
-handle_setvol(Client &client, ConstBuffer<const char *> args)
+handle_setvol(Client &client, Request args)
{
unsigned level;
if (!check_unsigned(client, &level, args.front()))
@@ -326,7 +327,7 @@ handle_setvol(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_volume(Client &client, ConstBuffer<const char *> args)
+handle_volume(Client &client, Request args)
{
int relative;
if (!check_int(client, &relative, args.front()))
@@ -360,20 +361,20 @@ handle_volume(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_stats(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_stats(Client &client, gcc_unused Request args)
{
stats_print(client);
return CommandResult::OK;
}
CommandResult
-handle_ping(gcc_unused Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_ping(gcc_unused Client &client, gcc_unused Request args)
{
return CommandResult::OK;
}
CommandResult
-handle_password(Client &client, ConstBuffer<const char *> args)
+handle_password(Client &client, Request args)
{
unsigned permission = 0;
@@ -388,7 +389,7 @@ handle_password(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_config(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_config(Client &client, gcc_unused Request args)
{
if (!client.IsLocal()) {
command_error(client, ACK_ERROR_PERMISSION,
@@ -408,7 +409,7 @@ handle_config(Client &client, gcc_unused ConstBuffer<const char *> args)
}
CommandResult
-handle_idle(Client &client, ConstBuffer<const char *> args)
+handle_idle(Client &client, Request args)
{
unsigned flags = 0;
diff --git a/src/command/OtherCommands.hxx b/src/command/OtherCommands.hxx
index c0b25dece..bcc1224e4 100644
--- a/src/command/OtherCommands.hxx
+++ b/src/command/OtherCommands.hxx
@@ -23,54 +23,54 @@
#include "CommandResult.hxx"
class Client;
-template<typename T> struct ConstBuffer;
+class Request;
CommandResult
-handle_urlhandlers(Client &client, ConstBuffer<const char *> args);
+handle_urlhandlers(Client &client, Request args);
CommandResult
-handle_decoders(Client &client, ConstBuffer<const char *> args);
+handle_decoders(Client &client, Request args);
CommandResult
-handle_tagtypes(Client &client, ConstBuffer<const char *> args);
+handle_tagtypes(Client &client, Request args);
CommandResult
-handle_kill(Client &client, ConstBuffer<const char *> args);
+handle_kill(Client &client, Request args);
CommandResult
-handle_close(Client &client, ConstBuffer<const char *> args);
+handle_close(Client &client, Request args);
CommandResult
-handle_listfiles(Client &client, ConstBuffer<const char *> args);
+handle_listfiles(Client &client, Request args);
CommandResult
-handle_lsinfo(Client &client, ConstBuffer<const char *> args);
+handle_lsinfo(Client &client, Request args);
CommandResult
-handle_update(Client &client, ConstBuffer<const char *> args);
+handle_update(Client &client, Request args);
CommandResult
-handle_rescan(Client &client, ConstBuffer<const char *> args);
+handle_rescan(Client &client, Request args);
CommandResult
-handle_setvol(Client &client, ConstBuffer<const char *> args);
+handle_setvol(Client &client, Request args);
CommandResult
-handle_volume(Client &client, ConstBuffer<const char *> args);
+handle_volume(Client &client, Request args);
CommandResult
-handle_stats(Client &client, ConstBuffer<const char *> args);
+handle_stats(Client &client, Request args);
CommandResult
-handle_ping(Client &client, ConstBuffer<const char *> args);
+handle_ping(Client &client, Request args);
CommandResult
-handle_password(Client &client, ConstBuffer<const char *> args);
+handle_password(Client &client, Request args);
CommandResult
-handle_config(Client &client, ConstBuffer<const char *> args);
+handle_config(Client &client, Request args);
CommandResult
-handle_idle(Client &client, ConstBuffer<const char *> args);
+handle_idle(Client &client, Request args);
#endif
diff --git a/src/command/OutputCommands.cxx b/src/command/OutputCommands.cxx
index 23eb7be5e..b562dc406 100644
--- a/src/command/OutputCommands.cxx
+++ b/src/command/OutputCommands.cxx
@@ -19,6 +19,7 @@
#include "config.h"
#include "OutputCommands.hxx"
+#include "Request.hxx"
#include "output/OutputPrint.hxx"
#include "output/OutputCommand.hxx"
#include "protocol/Result.hxx"
@@ -28,7 +29,7 @@
#include "util/ConstBuffer.hxx"
CommandResult
-handle_enableoutput(Client &client, ConstBuffer<const char *> args)
+handle_enableoutput(Client &client, Request args)
{
assert(args.size == 1);
@@ -46,7 +47,7 @@ handle_enableoutput(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_disableoutput(Client &client, ConstBuffer<const char *> args)
+handle_disableoutput(Client &client, Request args)
{
assert(args.size == 1);
@@ -64,7 +65,7 @@ handle_disableoutput(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_toggleoutput(Client &client, ConstBuffer<const char *> args)
+handle_toggleoutput(Client &client, Request args)
{
assert(args.size == 1);
@@ -82,7 +83,7 @@ handle_toggleoutput(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_devices(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_devices(Client &client, gcc_unused Request args)
{
assert(args.IsEmpty());
diff --git a/src/command/OutputCommands.hxx b/src/command/OutputCommands.hxx
index 985f27416..f985032a5 100644
--- a/src/command/OutputCommands.hxx
+++ b/src/command/OutputCommands.hxx
@@ -23,18 +23,18 @@
#include "CommandResult.hxx"
class Client;
-template<typename T> struct ConstBuffer;
+class Request;
CommandResult
-handle_enableoutput(Client &client, ConstBuffer<const char *> args);
+handle_enableoutput(Client &client, Request args);
CommandResult
-handle_disableoutput(Client &client, ConstBuffer<const char *> args);
+handle_disableoutput(Client &client, Request args);
CommandResult
-handle_toggleoutput(Client &client, ConstBuffer<const char *> args);
+handle_toggleoutput(Client &client, Request args);
CommandResult
-handle_devices(Client &client, ConstBuffer<const char *> args);
+handle_devices(Client &client, Request args);
#endif
diff --git a/src/command/PlayerCommands.cxx b/src/command/PlayerCommands.cxx
index 3686e7b90..c2a42bbf9 100644
--- a/src/command/PlayerCommands.cxx
+++ b/src/command/PlayerCommands.cxx
@@ -19,6 +19,7 @@
#include "config.h"
#include "PlayerCommands.hxx"
+#include "Request.hxx"
#include "CommandError.hxx"
#include "queue/Playlist.hxx"
#include "PlaylistPrint.hxx"
@@ -57,7 +58,7 @@
#define COMMAND_STATUS_UPDATING_DB "updating_db"
CommandResult
-handle_play(Client &client, ConstBuffer<const char *> args)
+handle_play(Client &client, Request args)
{
int song = -1;
@@ -68,7 +69,7 @@ handle_play(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_playid(Client &client, ConstBuffer<const char *> args)
+handle_playid(Client &client, Request args)
{
int id = -1;
@@ -80,21 +81,21 @@ handle_playid(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_stop(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_stop(Client &client, gcc_unused Request args)
{
client.partition.Stop();
return CommandResult::OK;
}
CommandResult
-handle_currentsong(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_currentsong(Client &client, gcc_unused Request args)
{
playlist_print_current(client, client.playlist);
return CommandResult::OK;
}
CommandResult
-handle_pause(Client &client, ConstBuffer<const char *> args)
+handle_pause(Client &client, Request args)
{
if (!args.IsEmpty()) {
bool pause_flag;
@@ -109,7 +110,7 @@ handle_pause(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_status(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_status(Client &client, gcc_unused Request args)
{
const char *state = nullptr;
int song;
@@ -223,7 +224,7 @@ handle_status(Client &client, gcc_unused ConstBuffer<const char *> args)
}
CommandResult
-handle_next(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_next(Client &client, gcc_unused Request args)
{
playlist &playlist = client.playlist;
@@ -239,14 +240,14 @@ handle_next(Client &client, gcc_unused ConstBuffer<const char *> args)
}
CommandResult
-handle_previous(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_previous(Client &client, gcc_unused Request args)
{
client.partition.PlayPrevious();
return CommandResult::OK;
}
CommandResult
-handle_repeat(Client &client, ConstBuffer<const char *> args)
+handle_repeat(Client &client, Request args)
{
bool status;
if (!check_bool(client, &status, args.front()))
@@ -257,7 +258,7 @@ handle_repeat(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_single(Client &client, ConstBuffer<const char *> args)
+handle_single(Client &client, Request args)
{
bool status;
if (!check_bool(client, &status, args.front()))
@@ -268,7 +269,7 @@ handle_single(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_consume(Client &client, ConstBuffer<const char *> args)
+handle_consume(Client &client, Request args)
{
bool status;
if (!check_bool(client, &status, args.front()))
@@ -279,7 +280,7 @@ handle_consume(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_random(Client &client, ConstBuffer<const char *> args)
+handle_random(Client &client, Request args)
{
bool status;
if (!check_bool(client, &status, args.front()))
@@ -291,14 +292,14 @@ handle_random(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_clearerror(gcc_unused Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_clearerror(gcc_unused Client &client, gcc_unused Request args)
{
client.player_control.ClearError();
return CommandResult::OK;
}
CommandResult
-handle_seek(Client &client, ConstBuffer<const char *> args)
+handle_seek(Client &client, Request args)
{
unsigned song;
SongTime seek_time;
@@ -314,7 +315,7 @@ handle_seek(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_seekid(Client &client, ConstBuffer<const char *> args)
+handle_seekid(Client &client, Request args)
{
unsigned id;
SongTime seek_time;
@@ -330,7 +331,7 @@ handle_seekid(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_seekcur(Client &client, ConstBuffer<const char *> args)
+handle_seekcur(Client &client, Request args)
{
const char *p = args.front();
bool relative = *p == '+' || *p == '-';
@@ -344,7 +345,7 @@ handle_seekcur(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_crossfade(Client &client, ConstBuffer<const char *> args)
+handle_crossfade(Client &client, Request args)
{
unsigned xfade_time;
@@ -356,7 +357,7 @@ handle_crossfade(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_mixrampdb(Client &client, ConstBuffer<const char *> args)
+handle_mixrampdb(Client &client, Request args)
{
float db;
@@ -368,7 +369,7 @@ handle_mixrampdb(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_mixrampdelay(Client &client, ConstBuffer<const char *> args)
+handle_mixrampdelay(Client &client, Request args)
{
float delay_secs;
@@ -380,7 +381,7 @@ handle_mixrampdelay(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_replay_gain_mode(Client &client, ConstBuffer<const char *> args)
+handle_replay_gain_mode(Client &client, Request args)
{
if (!replay_gain_set_mode_string(args.front())) {
command_error(client, ACK_ERROR_ARG,
@@ -393,7 +394,7 @@ handle_replay_gain_mode(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_replay_gain_status(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_replay_gain_status(Client &client, gcc_unused Request args)
{
client_printf(client, "replay_gain_mode: %s\n",
replay_gain_get_mode_string());
diff --git a/src/command/PlayerCommands.hxx b/src/command/PlayerCommands.hxx
index 1d7bfa366..ecf2c05ab 100644
--- a/src/command/PlayerCommands.hxx
+++ b/src/command/PlayerCommands.hxx
@@ -23,69 +23,69 @@
#include "CommandResult.hxx"
class Client;
-template<typename T> struct ConstBuffer;
+class Request;
CommandResult
-handle_play(Client &client, ConstBuffer<const char *> args);
+handle_play(Client &client, Request args);
CommandResult
-handle_playid(Client &client, ConstBuffer<const char *> args);
+handle_playid(Client &client, Request args);
CommandResult
-handle_stop(Client &client, ConstBuffer<const char *> args);
+handle_stop(Client &client, Request args);
CommandResult
-handle_currentsong(Client &client, ConstBuffer<const char *> args);
+handle_currentsong(Client &client, Request args);
CommandResult
-handle_pause(Client &client, ConstBuffer<const char *> args);
+handle_pause(Client &client, Request args);
CommandResult
-handle_status(Client &client, ConstBuffer<const char *> args);
+handle_status(Client &client, Request args);
CommandResult
-handle_next(Client &client, ConstBuffer<const char *> args);
+handle_next(Client &client, Request args);
CommandResult
-handle_previous(Client &client, ConstBuffer<const char *> args);
+handle_previous(Client &client, Request args);
CommandResult
-handle_repeat(Client &client, ConstBuffer<const char *> args);
+handle_repeat(Client &client, Request args);
CommandResult
-handle_single(Client &client, ConstBuffer<const char *> args);
+handle_single(Client &client, Request args);
CommandResult
-handle_consume(Client &client, ConstBuffer<const char *> args);
+handle_consume(Client &client, Request args);
CommandResult
-handle_random(Client &client, ConstBuffer<const char *> args);
+handle_random(Client &client, Request args);
CommandResult
-handle_clearerror(Client &client, ConstBuffer<const char *> args);
+handle_clearerror(Client &client, Request args);
CommandResult
-handle_seek(Client &client, ConstBuffer<const char *> args);
+handle_seek(Client &client, Request args);
CommandResult
-handle_seekid(Client &client, ConstBuffer<const char *> args);
+handle_seekid(Client &client, Request args);
CommandResult
-handle_seekcur(Client &client, ConstBuffer<const char *> args);
+handle_seekcur(Client &client, Request args);
CommandResult
-handle_crossfade(Client &client, ConstBuffer<const char *> args);
+handle_crossfade(Client &client, Request args);
CommandResult
-handle_mixrampdb(Client &client, ConstBuffer<const char *> args);
+handle_mixrampdb(Client &client, Request args);
CommandResult
-handle_mixrampdelay(Client &client, ConstBuffer<const char *> args);
+handle_mixrampdelay(Client &client, Request args);
CommandResult
-handle_replay_gain_mode(Client &client, ConstBuffer<const char *> args);
+handle_replay_gain_mode(Client &client, Request args);
CommandResult
-handle_replay_gain_status(Client &client, ConstBuffer<const char *> args);
+handle_replay_gain_status(Client &client, Request args);
#endif
diff --git a/src/command/PlaylistCommands.cxx b/src/command/PlaylistCommands.cxx
index 83ac482ea..56da71078 100644
--- a/src/command/PlaylistCommands.cxx
+++ b/src/command/PlaylistCommands.cxx
@@ -19,6 +19,7 @@
#include "config.h"
#include "PlaylistCommands.hxx"
+#include "Request.hxx"
#include "db/DatabasePlaylist.hxx"
#include "CommandError.hxx"
#include "PlaylistPrint.hxx"
@@ -59,7 +60,7 @@ print_spl_list(Client &client, const PlaylistVector &list)
}
CommandResult
-handle_save(Client &client, ConstBuffer<const char *> args)
+handle_save(Client &client, Request args)
{
Error error;
return spl_save_playlist(args.front(), client.playlist, error)
@@ -68,7 +69,7 @@ handle_save(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_load(Client &client, ConstBuffer<const char *> args)
+handle_load(Client &client, Request args)
{
RangeArg range;
if (args.size < 2)
@@ -90,7 +91,7 @@ handle_load(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_listplaylist(Client &client, ConstBuffer<const char *> args)
+handle_listplaylist(Client &client, Request args)
{
const char *const name = args.front();
@@ -104,7 +105,7 @@ handle_listplaylist(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_listplaylistinfo(Client &client, ConstBuffer<const char *> args)
+handle_listplaylistinfo(Client &client, Request args)
{
const char *const name = args.front();
@@ -118,7 +119,7 @@ handle_listplaylistinfo(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_rm(Client &client, ConstBuffer<const char *> args)
+handle_rm(Client &client, Request args)
{
const char *const name = args.front();
@@ -129,7 +130,7 @@ handle_rm(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_rename(Client &client, ConstBuffer<const char *> args)
+handle_rename(Client &client, Request args)
{
const char *const old_name = args[0];
const char *const new_name = args[1];
@@ -141,7 +142,7 @@ handle_rename(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_playlistdelete(Client &client, ConstBuffer<const char *> args)
+handle_playlistdelete(Client &client, Request args)
{
const char *const name = args[0];
unsigned from;
@@ -156,7 +157,7 @@ handle_playlistdelete(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_playlistmove(Client &client, ConstBuffer<const char *> args)
+handle_playlistmove(Client &client, Request args)
{
const char *const name = args.front();
unsigned from, to;
@@ -173,7 +174,7 @@ handle_playlistmove(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_playlistclear(Client &client, ConstBuffer<const char *> args)
+handle_playlistclear(Client &client, Request args)
{
const char *const name = args.front();
@@ -184,7 +185,7 @@ handle_playlistclear(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_playlistadd(Client &client, ConstBuffer<const char *> args)
+handle_playlistadd(Client &client, Request args)
{
const char *const playlist = args[0];
const char *const uri = args[1];
@@ -218,7 +219,7 @@ handle_playlistadd(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_listplaylists(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_listplaylists(Client &client, gcc_unused Request args)
{
Error error;
const auto list = ListPlaylistFiles(error);
diff --git a/src/command/PlaylistCommands.hxx b/src/command/PlaylistCommands.hxx
index 5ac345e57..276d27ad8 100644
--- a/src/command/PlaylistCommands.hxx
+++ b/src/command/PlaylistCommands.hxx
@@ -24,43 +24,43 @@
#include "Compiler.h"
class Client;
-template<typename T> struct ConstBuffer;
+class Request;
gcc_const
bool
playlist_commands_available();
CommandResult
-handle_save(Client &client, ConstBuffer<const char *> args);
+handle_save(Client &client, Request args);
CommandResult
-handle_load(Client &client, ConstBuffer<const char *> args);
+handle_load(Client &client, Request args);
CommandResult
-handle_listplaylist(Client &client, ConstBuffer<const char *> args);
+handle_listplaylist(Client &client, Request args);
CommandResult
-handle_listplaylistinfo(Client &client, ConstBuffer<const char *> args);
+handle_listplaylistinfo(Client &client, Request args);
CommandResult
-handle_rm(Client &client, ConstBuffer<const char *> args);
+handle_rm(Client &client, Request args);
CommandResult
-handle_rename(Client &client, ConstBuffer<const char *> args);
+handle_rename(Client &client, Request args);
CommandResult
-handle_playlistdelete(Client &client, ConstBuffer<const char *> args);
+handle_playlistdelete(Client &client, Request args);
CommandResult
-handle_playlistmove(Client &client, ConstBuffer<const char *> args);
+handle_playlistmove(Client &client, Request args);
CommandResult
-handle_playlistclear(Client &client, ConstBuffer<const char *> args);
+handle_playlistclear(Client &client, Request args);
CommandResult
-handle_playlistadd(Client &client, ConstBuffer<const char *> args);
+handle_playlistadd(Client &client, Request args);
CommandResult
-handle_listplaylists(Client &client, ConstBuffer<const char *> args);
+handle_listplaylists(Client &client, Request args);
#endif
diff --git a/src/command/QueueCommands.cxx b/src/command/QueueCommands.cxx
index 5e051fc91..c11af26bb 100644
--- a/src/command/QueueCommands.cxx
+++ b/src/command/QueueCommands.cxx
@@ -19,6 +19,7 @@
#include "config.h"
#include "QueueCommands.hxx"
+#include "Request.hxx"
#include "CommandError.hxx"
#include "db/DatabaseQueue.hxx"
#include "db/Selection.hxx"
@@ -54,7 +55,7 @@ translate_uri(const char *uri)
}
CommandResult
-handle_add(Client &client, ConstBuffer<const char *> args)
+handle_add(Client &client, Request args)
{
const char *uri = args.front();
if (memcmp(uri, "/", 2) == 0)
@@ -92,7 +93,7 @@ handle_add(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_addid(Client &client, ConstBuffer<const char *> args)
+handle_addid(Client &client, Request args)
{
const char *const uri = translate_uri(args.front());
@@ -151,7 +152,7 @@ parse_time_range(const char *p, SongTime &start_r, SongTime &end_r)
}
CommandResult
-handle_rangeid(Client &client, ConstBuffer<const char *> args)
+handle_rangeid(Client &client, Request args)
{
unsigned id;
if (!check_unsigned(client, &id, args.front()))
@@ -173,7 +174,7 @@ handle_rangeid(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_delete(Client &client, ConstBuffer<const char *> args)
+handle_delete(Client &client, Request args)
{
RangeArg range;
if (!ParseCommandArg(client, range, args.front()))
@@ -184,7 +185,7 @@ handle_delete(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_deleteid(Client &client, ConstBuffer<const char *> args)
+handle_deleteid(Client &client, Request args)
{
unsigned id;
@@ -196,14 +197,14 @@ handle_deleteid(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_playlist(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_playlist(Client &client, gcc_unused Request args)
{
playlist_print_uris(client, client.playlist);
return CommandResult::OK;
}
CommandResult
-handle_shuffle(gcc_unused Client &client, ConstBuffer<const char *> args)
+handle_shuffle(gcc_unused Client &client, Request args)
{
RangeArg range;
if (args.IsEmpty())
@@ -216,14 +217,14 @@ handle_shuffle(gcc_unused Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_clear(gcc_unused Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_clear(gcc_unused Client &client, gcc_unused Request args)
{
client.partition.ClearQueue();
return CommandResult::OK;
}
CommandResult
-handle_plchanges(Client &client, ConstBuffer<const char *> args)
+handle_plchanges(Client &client, Request args)
{
uint32_t version;
@@ -235,7 +236,7 @@ handle_plchanges(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_plchangesposid(Client &client, ConstBuffer<const char *> args)
+handle_plchangesposid(Client &client, Request args)
{
uint32_t version;
@@ -247,7 +248,7 @@ handle_plchangesposid(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_playlistinfo(Client &client, ConstBuffer<const char *> args)
+handle_playlistinfo(Client &client, Request args)
{
RangeArg range;
if (args.IsEmpty())
@@ -264,7 +265,7 @@ handle_playlistinfo(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_playlistid(Client &client, ConstBuffer<const char *> args)
+handle_playlistid(Client &client, Request args)
{
if (!args.IsEmpty()) {
unsigned id;
@@ -284,7 +285,7 @@ handle_playlistid(Client &client, ConstBuffer<const char *> args)
}
static CommandResult
-handle_playlist_match(Client &client, ConstBuffer<const char *> args,
+handle_playlist_match(Client &client, Request args,
bool fold_case)
{
SongFilter filter;
@@ -298,19 +299,19 @@ handle_playlist_match(Client &client, ConstBuffer<const char *> args,
}
CommandResult
-handle_playlistfind(Client &client, ConstBuffer<const char *> args)
+handle_playlistfind(Client &client, Request args)
{
return handle_playlist_match(client, args, false);
}
CommandResult
-handle_playlistsearch(Client &client, ConstBuffer<const char *> args)
+handle_playlistsearch(Client &client, Request args)
{
return handle_playlist_match(client, args, true);
}
CommandResult
-handle_prio(Client &client, ConstBuffer<const char *> args)
+handle_prio(Client &client, Request args)
{
const char *const priority_string = args.shift();
unsigned priority;
@@ -341,7 +342,7 @@ handle_prio(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_prioid(Client &client, ConstBuffer<const char *> args)
+handle_prioid(Client &client, Request args)
{
const char *const priority_string = args.shift();
unsigned priority;
@@ -370,7 +371,7 @@ handle_prioid(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_move(Client &client, ConstBuffer<const char *> args)
+handle_move(Client &client, Request args)
{
RangeArg range;
int to;
@@ -386,7 +387,7 @@ handle_move(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_moveid(Client &client, ConstBuffer<const char *> args)
+handle_moveid(Client &client, Request args)
{
unsigned id;
int to;
@@ -400,7 +401,7 @@ handle_moveid(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_swap(Client &client, ConstBuffer<const char *> args)
+handle_swap(Client &client, Request args)
{
unsigned song1, song2;
@@ -415,7 +416,7 @@ handle_swap(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_swapid(Client &client, ConstBuffer<const char *> args)
+handle_swapid(Client &client, Request args)
{
unsigned id1, id2;
diff --git a/src/command/QueueCommands.hxx b/src/command/QueueCommands.hxx
index 48641d2d1..bccb9a370 100644
--- a/src/command/QueueCommands.hxx
+++ b/src/command/QueueCommands.hxx
@@ -23,66 +23,66 @@
#include "CommandResult.hxx"
class Client;
-template<typename T> struct ConstBuffer;
+class Request;
CommandResult
-handle_add(Client &client, ConstBuffer<const char *> args);
+handle_add(Client &client, Request args);
CommandResult
-handle_addid(Client &client, ConstBuffer<const char *> args);
+handle_addid(Client &client, Request args);
CommandResult
-handle_rangeid(Client &client, ConstBuffer<const char *> args);
+handle_rangeid(Client &client, Request args);
CommandResult
-handle_delete(Client &client, ConstBuffer<const char *> args);
+handle_delete(Client &client, Request args);
CommandResult
-handle_deleteid(Client &client, ConstBuffer<const char *> args);
+handle_deleteid(Client &client, Request args);
CommandResult
-handle_playlist(Client &client, ConstBuffer<const char *> args);
+handle_playlist(Client &client, Request args);
CommandResult
-handle_shuffle(Client &client, ConstBuffer<const char *> args);
+handle_shuffle(Client &client, Request args);
CommandResult
-handle_clear(Client &client, ConstBuffer<const char *> args);
+handle_clear(Client &client, Request args);
CommandResult
-handle_plchanges(Client &client, ConstBuffer<const char *> args);
+handle_plchanges(Client &client, Request args);
CommandResult
-handle_plchangesposid(Client &client, ConstBuffer<const char *> args);
+handle_plchangesposid(Client &client, Request args);
CommandResult
-handle_playlistinfo(Client &client, ConstBuffer<const char *> args);
+handle_playlistinfo(Client &client, Request args);
CommandResult
-handle_playlistid(Client &client, ConstBuffer<const char *> args);
+handle_playlistid(Client &client, Request args);
CommandResult
-handle_playlistfind(Client &client, ConstBuffer<const char *> args);
+handle_playlistfind(Client &client, Request args);
CommandResult
-handle_playlistsearch(Client &client, ConstBuffer<const char *> args);
+handle_playlistsearch(Client &client, Request args);
CommandResult
-handle_prio(Client &client, ConstBuffer<const char *> args);
+handle_prio(Client &client, Request args);
CommandResult
-handle_prioid(Client &client, ConstBuffer<const char *> args);
+handle_prioid(Client &client, Request args);
CommandResult
-handle_move(Client &client, ConstBuffer<const char *> args);
+handle_move(Client &client, Request args);
CommandResult
-handle_moveid(Client &client, ConstBuffer<const char *> args);
+handle_moveid(Client &client, Request args);
CommandResult
-handle_swap(Client &client, ConstBuffer<const char *> args);
+handle_swap(Client &client, Request args);
CommandResult
-handle_swapid(Client &client, ConstBuffer<const char *> args);
+handle_swapid(Client &client, Request args);
#endif
diff --git a/src/command/Request.hxx b/src/command/Request.hxx
new file mode 100644
index 000000000..18fdff7f3
--- /dev/null
+++ b/src/command/Request.hxx
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
+ * http://www.musicpd.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef MPD_REQUEST_HXX
+#define MPD_REQUEST_HXX
+
+#include "check.h"
+#include "util/ConstBuffer.hxx"
+
+class Request : public ConstBuffer<const char *> {
+ typedef ConstBuffer<const char *> Base;
+
+public:
+ constexpr Request(const char *const*argv, size_type n)
+ :Base(argv, n) {}
+};
+
+#endif
diff --git a/src/command/StickerCommands.cxx b/src/command/StickerCommands.cxx
index 9dda3c65d..a28408547 100644
--- a/src/command/StickerCommands.cxx
+++ b/src/command/StickerCommands.cxx
@@ -19,6 +19,7 @@
#include "config.h"
#include "StickerCommands.hxx"
+#include "Request.hxx"
#include "SongPrint.hxx"
#include "db/Interface.hxx"
#include "db/DatabaseGlue.hxx"
@@ -52,7 +53,7 @@ sticker_song_find_print_cb(const LightSong &song, const char *value,
}
static CommandResult
-handle_sticker_song(Client &client, ConstBuffer<const char *> args)
+handle_sticker_song(Client &client, Request args)
{
Error error;
const Database *db = client.GetDatabase(error);
@@ -191,7 +192,7 @@ handle_sticker_song(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_sticker(Client &client, ConstBuffer<const char *> args)
+handle_sticker(Client &client, Request args)
{
assert(args.size >= 3);
diff --git a/src/command/StickerCommands.hxx b/src/command/StickerCommands.hxx
index 8b7a8f7bf..51682d29f 100644
--- a/src/command/StickerCommands.hxx
+++ b/src/command/StickerCommands.hxx
@@ -23,9 +23,9 @@
#include "CommandResult.hxx"
class Client;
-template<typename T> struct ConstBuffer;
+class Request;
CommandResult
-handle_sticker(Client &client, ConstBuffer<const char *> args);
+handle_sticker(Client &client, Request args);
#endif
diff --git a/src/command/StorageCommands.cxx b/src/command/StorageCommands.cxx
index 5bb37ae6f..3f1e5f321 100644
--- a/src/command/StorageCommands.cxx
+++ b/src/command/StorageCommands.cxx
@@ -21,6 +21,7 @@
#include "config.h"
#include "StorageCommands.hxx"
+#include "Request.hxx"
#include "CommandError.hxx"
#include "protocol/Result.hxx"
#include "util/UriUtil.hxx"
@@ -168,7 +169,7 @@ print_storage_uri(Client &client, const Storage &storage)
}
CommandResult
-handle_listmounts(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_listmounts(Client &client, gcc_unused Request args)
{
Storage *_composite = client.partition.instance.storage;
if (_composite == nullptr) {
@@ -190,7 +191,7 @@ handle_listmounts(Client &client, gcc_unused ConstBuffer<const char *> args)
}
CommandResult
-handle_mount(Client &client, ConstBuffer<const char *> args)
+handle_mount(Client &client, Request args)
{
Storage *_composite = client.partition.instance.storage;
if (_composite == nullptr) {
@@ -253,7 +254,7 @@ handle_mount(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_unmount(Client &client, ConstBuffer<const char *> args)
+handle_unmount(Client &client, Request args)
{
Storage *_composite = client.partition.instance.storage;
if (_composite == nullptr) {
diff --git a/src/command/StorageCommands.hxx b/src/command/StorageCommands.hxx
index 4a96b4058..f5f962042 100644
--- a/src/command/StorageCommands.hxx
+++ b/src/command/StorageCommands.hxx
@@ -24,7 +24,7 @@
class Client;
class Storage;
-template<typename T> struct ConstBuffer;
+class Request;
CommandResult
handle_listfiles_storage(Client &client, Storage &storage, const char *uri);
@@ -33,12 +33,12 @@ CommandResult
handle_listfiles_storage(Client &client, const char *uri);
CommandResult
-handle_listmounts(Client &client, ConstBuffer<const char *> args);
+handle_listmounts(Client &client, Request args);
CommandResult
-handle_mount(Client &client, ConstBuffer<const char *> args);
+handle_mount(Client &client, Request args);
CommandResult
-handle_unmount(Client &client, ConstBuffer<const char *> args);
+handle_unmount(Client &client, Request args);
#endif
diff --git a/src/command/TagCommands.cxx b/src/command/TagCommands.cxx
index bf5b67511..8997c84c3 100644
--- a/src/command/TagCommands.cxx
+++ b/src/command/TagCommands.cxx
@@ -19,6 +19,7 @@
#include "config.h"
#include "TagCommands.hxx"
+#include "Request.hxx"
#include "CommandError.hxx"
#include "client/Client.hxx"
#include "protocol/ArgParser.hxx"
@@ -28,7 +29,7 @@
#include "util/ConstBuffer.hxx"
CommandResult
-handle_addtagid(Client &client, ConstBuffer<const char *> args)
+handle_addtagid(Client &client, Request args)
{
unsigned song_id;
if (!check_unsigned(client, &song_id, args.front()))
@@ -53,7 +54,7 @@ handle_addtagid(Client &client, ConstBuffer<const char *> args)
}
CommandResult
-handle_cleartagid(Client &client, ConstBuffer<const char *> args)
+handle_cleartagid(Client &client, Request args)
{
unsigned song_id;
if (!check_unsigned(client, &song_id, args.front()))
diff --git a/src/command/TagCommands.hxx b/src/command/TagCommands.hxx
index ee7c27bb9..12d40b5a3 100644
--- a/src/command/TagCommands.hxx
+++ b/src/command/TagCommands.hxx
@@ -23,12 +23,12 @@
#include "CommandResult.hxx"
class Client;
-template<typename T> struct ConstBuffer;
+class Request;
CommandResult
-handle_addtagid(Client &client, ConstBuffer<const char *> args);
+handle_addtagid(Client &client, Request args);
CommandResult
-handle_cleartagid(Client &client, ConstBuffer<const char *> args);
+handle_cleartagid(Client &client, Request args);
#endif