Root/src/clock.h

Source at commit 73ceffa51d3450d2d20ce933e7fc6da187e09fc8 created 7 years 5 months ago.
By Maarten ter Huurne, Fix bug in section directory creation method
1#ifndef __CLOCK_H__
2#define __CLOCK_H__
3
4#include <memory>
5#include <string>
6
7
8/**
9 * A keeper of wall clock time with minute accuracy.
10 * Sends a user event on every minute boundary, to force a repaint of the
11 * clock display.
12 */
13class Clock {
14public:
15    /**
16     * Used by implementation; please ignore.
17     */
18    class Timer;
19
20    Clock();
21
22    /**
23     * Gets a string representation of the current time.
24     * Uses 24-hour format if is24 is true, otherwise AM/PM.
25     */
26    std::string getTime(bool is24 = true);
27
28private:
29    std::shared_ptr<Timer> timer;
30};
31
32#endif /* __CLOCK_H__ */
33

Archive Download this file



interactive