mpd/src/command/CommandListBuilder.cxx

27 lines
446 B
C++
Raw Normal View History

// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright The Music Player Daemon Project
#include "CommandListBuilder.hxx"
2019-04-03 21:31:32 +02:00
#include "client/Config.hxx"
#include <string.h>
void
CommandListBuilder::Reset()
{
list.clear();
2013-01-04 01:10:48 +01:00
mode = Mode::DISABLED;
}
bool
CommandListBuilder::Add(const char *cmd)
{
size_t len = strlen(cmd) + 1;
2013-01-04 01:10:48 +01:00
size += len;
if (size > client_max_command_list_size)
return false;
list.emplace_back(cmd);
return true;
}