]> granicus.if.org Git - icinga2/blob - lib/base/datetime.hpp
Merge pull request #7185 from Icinga/bugfix/gelfwriter-wrong-log-facility
[icinga2] / lib / base / datetime.hpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #ifndef DATETIME_H
4 #define DATETIME_H
5
6 #include "base/i2-base.hpp"
7 #include "base/datetime-ti.hpp"
8 #include "base/value.hpp"
9 #include <vector>
10
11 namespace icinga
12 {
13
14 /**
15  * A date/time value.
16  *
17  * @ingroup base
18  */
19 class DateTime final : public ObjectImpl<DateTime>
20 {
21 public:
22         DECLARE_OBJECT(DateTime);
23
24         DateTime(double value);
25         DateTime(const std::vector<Value>& args);
26
27         String Format(const String& format) const;
28
29         double GetValue() const override;
30         String ToString() const override;
31
32         static Object::Ptr GetPrototype();
33
34 private:
35         double m_Value;
36 };
37
38 }
39
40 #endif /* DATETIME_H */