diff options
author | Max Kellermann <max@musicpd.org> | 2018-09-02 07:45:45 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-09-02 08:17:22 +0200 |
commit | 68f824a18640f7e582175a3e3a0b7d3fc60f207c (patch) | |
tree | 7ac2fcc340d9b42c55335317dca8a70c0dbb14c6 /src/protocol | |
parent | b9cca49e1461e142f1f0946dcb930c7bf1517566 (diff) |
protocol/ArgParser: move struct RangeArg to separate header
Diffstat (limited to 'src/protocol')
-rw-r--r-- | src/protocol/ArgParser.cxx | 1 | ||||
-rw-r--r-- | src/protocol/ArgParser.hxx | 16 | ||||
-rw-r--r-- | src/protocol/RangeArg.hxx | 40 |
3 files changed, 42 insertions, 15 deletions
diff --git a/src/protocol/ArgParser.cxx b/src/protocol/ArgParser.cxx index bdc28bcbf..23d203931 100644 --- a/src/protocol/ArgParser.cxx +++ b/src/protocol/ArgParser.cxx @@ -19,6 +19,7 @@ #include "config.h" #include "ArgParser.hxx" +#include "RangeArg.hxx" #include "Ack.hxx" #include "Chrono.hxx" #include "util/NumberParser.hxx" diff --git a/src/protocol/ArgParser.hxx b/src/protocol/ArgParser.hxx index 8a23f25a8..d2844e016 100644 --- a/src/protocol/ArgParser.hxx +++ b/src/protocol/ArgParser.hxx @@ -22,10 +22,9 @@ #include "check.h" -#include <limits> - #include <stdint.h> +struct RangeArg; class SongTime; class SignedSongTime; @@ -38,19 +37,6 @@ ParseCommandArgInt(const char *s, int min_value, int max_value); int ParseCommandArgInt(const char *s); -struct RangeArg { - unsigned start, end; - - void SetAll() { - start = 0; - end = std::numeric_limits<unsigned>::max(); - } - - static constexpr RangeArg All() { - return { 0, std::numeric_limits<unsigned>::max() }; - } -}; - RangeArg ParseCommandArgRange(const char *s); diff --git a/src/protocol/RangeArg.hxx b/src/protocol/RangeArg.hxx new file mode 100644 index 000000000..3eca8a75e --- /dev/null +++ b/src/protocol/RangeArg.hxx @@ -0,0 +1,40 @@ +/* + * Copyright 2003-2018 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_PROTOCOL_RANGE_ARG_HXX +#define MPD_PROTOCOL_RANGE_ARG_HXX + +#include "check.h" + +#include <limits> + +struct RangeArg { + unsigned start, end; + + void SetAll() { + start = 0; + end = std::numeric_limits<unsigned>::max(); + } + + static constexpr RangeArg All() { + return { 0, std::numeric_limits<unsigned>::max() }; + } +}; + +#endif |