ROSE 0.11.145.147
DurationParser.h
1#ifndef ROSE_CommandLine_DurationParser_H
2#define ROSE_CommandLine_DurationParser_H
3
4#include <Rose/CommandLine/SuffixMultiplierParser.h>
5
6namespace Rose {
7namespace CommandLine {
8
10class DurationParser: public SuffixMultiplierParser<uint64_t> {
12protected:
14
16 : Super(valueSaver) {}
17
18public:
21
23 static Ptr instance();
24
27
29 static std::string docString();
30
34 std::string toString(const Sawyer::Optional<uint64_t> &seconds);
35};
36
48
49} // namespace
50} // namespace
51
52#endif
Command-line parser for durations.
std::string toString(const Sawyer::Optional< uint64_t > &seconds)
Convert seconds to a parsable string.
static std::string docString()
Runtime documentation.
static Ptr instance()
Default allocating constructor.
static Ptr instance(const Sawyer::CommandLine::ValueSaver::Ptr &)
Allocating constructor.
Parse values followed by unit names.
const ValueSaver::Ptr valueSaver() const
Property: functor responsible for saving a parsed value in user storage.
Holds a value or nothing.
Definition Optional.h:56
DurationParser::Ptr durationParser()
Constructs a DurationParser.
The ROSE library.