BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
DateAndTime.h
Go to the documentation of this file.
1//Dear emacs, this is -*- c++ -*-
2
3/**
4 * @file eformat/DateAndTime.h
5 * @author <a href="mailto:[email protected]">Andre DOS ANJOS</a>
6 * $Author: zhangy $
7 * $Revision: 1.1.1.1 $
8 * $Date: 2009/06/19 07:35:41 $
9 *
10 * @brief Describes how to create and interpret a date and time field.
11 */
12
13#ifndef EFORMAT_HELPER_DATEANDTIME_H
14#define EFORMAT_HELPER_DATEANDTIME_H
15
16#include <stdint.h>
17#include <string>
18
19namespace eformat {
20
21 namespace helper {
22
23 /**
24 * Interprets and composes a date and time field (32-bit unsigned integer)
25 */
27
28 public: //interface
29
30 /**
31 * Default constructor, it means, now
32 */
33 DateAndTime ();
34
35 /**
36 * Build from an existing date in time
37 *
38 * @param val The value of the compiled date and time field
39 */
40 DateAndTime (uint32_t val);
41
42 /**
43 * Get the current representation
44 */
45 inline uint32_t code (void) const { return m_val; }
46
47 /**
48 * Returns a string that represents the time in ISO8601
49 */
50 std::string iso8601 (void) const;
51
52 /**
53 * Returns a string that represents the time in a human readable format
54 */
55 std::string human (void) const;
56
57 private: //implementation
58
59 uint32_t m_val; ///< my current value
60
61 };
62
63 }
64
65}
66
67#endif /* EFORMAT_HELPER_DATEANDTIME_H */
std::string iso8601(void) const
Definition: DateAndTime.cxx:26
uint32_t code(void) const
Definition: DateAndTime.h:45
std::string human(void) const
Definition: DateAndTime.cxx:36