ROSE  0.11.96.11
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
Sawyer::Optional
Holds a value or nothing.
Definition: Optional.h:49
Rose::CommandLine::DurationParser
Command-line parser for durations.
Definition: DurationParser.h:10
Rose::CommandLine::DurationParser::instance
static Ptr instance()
Default allocating constructor.
Sawyer::SharedPointer< ValueSaver >
Rose::CommandLine::durationParser
DurationParser::Ptr durationParser(uint64_t &storage)
Constructs a DurationParser.
Rose::CommandLine::SuffixMultiplierParser
Parse values followed by unit names.
Definition: SuffixMultiplierParser.h:34
Rose::CommandLine::DurationParser::docString
static std::string docString()
Runtime documentation.
Rose
Main namespace for the ROSE library.
Definition: BinaryTutorial.dox:3
Sawyer::CommandLine::ValueParser::valueSaver
const ValueSaver::Ptr valueSaver() const
Property: functor responsible for saving a parsed value in user storage.
Definition: util/Sawyer/CommandLine.h:741
Rose::CommandLine::DurationParser::toString
std::string toString(const Sawyer::Optional< uint64_t > &seconds)
Convert seconds to a parsable string.