ROSE  0.11.145.0
DurationParser.h
1 #ifndef ROSE_CommandLine_DurationParser_H
2 #define ROSE_CommandLine_DurationParser_H
3 
4 #include <Rose/CommandLine/SuffixMultiplierParser.h>
5 
6 namespace Rose {
7 namespace CommandLine {
8 
10 class DurationParser: public SuffixMultiplierParser<uint64_t> {
12 protected:
13  DurationParser() {}
14 
16  : Super(valueSaver) {}
17 
18 public:
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 
42 DurationParser::Ptr durationParser(uint64_t &storage);
48 
49 } // namespace
50 } // namespace
51 
52 #endif
DurationParser::Ptr durationParser(uint64_t &storage)
Constructs a DurationParser.
const ValueSaver::Ptr valueSaver() const
Property: functor responsible for saving a parsed value in user storage.
static std::string docString()
Runtime documentation.
static Ptr instance()
Default allocating constructor.
Main namespace for the ROSE library.
std::string toString(const Sawyer::Optional< uint64_t > &seconds)
Convert seconds to a parsable string.
Parse values followed by unit names.
Command-line parser for durations.