summaryrefslogtreecommitdiff
path: root/src/bookmouse_time.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bookmouse_time.hpp')
-rw-r--r--src/bookmouse_time.hpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/bookmouse_time.hpp b/src/bookmouse_time.hpp
new file mode 100644
index 0000000..5bd15a9
--- /dev/null
+++ b/src/bookmouse_time.hpp
@@ -0,0 +1,32 @@
+#ifndef BOOKMOUSE_TIME_HPP
+#define BOOKMOUSE_TIME_HPP
+
+#include <fud_status.hpp>
+#include <fud_result.hpp>
+#include <fud_string.hpp>
+
+#include <ctime>
+
+namespace bookmouse {
+
+using TimeInfo = struct tm;
+
+class TimeFormat {
+public:
+ explicit TimeFormat(const char* format);
+ explicit TimeFormat(const fud::String& format);
+
+ fud::Result<fud::String, fud::FudStatus> format(const TimeInfo& timeInfo);
+
+ // fud::FudStatus setFormatString(const fud::String& format);
+
+private:
+ fud::String m_format;
+ size_t m_sizeNeeded;
+ bool m_utf8Valid{false};
+};
+
+
+} // namespace bookmouse
+
+#endif