@@ -15,12 +15,17 @@ class ColumnDate : public Column {
1515 ColumnDate ();
1616
1717 // / Appends one element to the end of column.
18- // / TODO: The implementation is fundamentally wrong.
18+ // / The implementation is fundamentally wrong, ignores timezones, leap years and daylight saving .
1919 void Append (const std::time_t & value);
2020
2121 // / Returns element at given row number.
22- // / TODO: The implementation is fundamentally wrong.
22+ // / The implementation is fundamentally wrong, ignores timezones, leap years and daylight saving .
2323 std::time_t At (size_t n) const ;
24+ inline std::time_t operator [] (size_t n) const { return At (n); }
25+
26+ // / Do append data as is -- number of day in Unix epoch, no conversions performed.
27+ void AppendRaw (uint16_t value);
28+ uint16_t RawAt (size_t n) const ;
2429
2530 // / Appends content of given column to the end of current one.
2631 void Append (ColumnRef column) override ;
@@ -56,16 +61,22 @@ class ColumnDate32 : public Column {
5661 ColumnDate32 ();
5762
5863 // / Appends one element to the end of column.
59- // / TODO: The implementation is fundamentally wrong.
64+ // / The implementation is fundamentally wrong, ignores timezones, leap years and daylight saving .
6065 void Append (const std::time_t & value);
6166
6267 // / Returns element at given row number.
63- // / TODO: The implementation is fundamentally wrong.
68+ // / The implementation is fundamentally wrong, ignores timezones, leap years and daylight saving .
6469 std::time_t At (size_t n) const ;
6570
6671 // / Appends content of given column to the end of current one.
6772 void Append (ColumnRef column) override ;
6873
74+ inline std::time_t operator [] (size_t n) const { return At (n); }
75+
76+ // / Do append data as is -- number of day in Unix epoch (32bit signed), no conversions performed.
77+ void AppendRaw (int32_t value);
78+ int32_t RawAt (size_t n) const ;
79+
6980 // / Loads column data from input stream.
7081 bool LoadBody (InputStream* input, size_t rows) override ;
7182
@@ -90,7 +101,7 @@ class ColumnDate32 : public Column {
90101};
91102
92103
93- /* * */
104+ /* * DateTime64 supports date-time values (number of seconds since UNIX epoch), from 1970 up to 2130. */
94105class ColumnDateTime : public Column {
95106public:
96107 using ValueType = std::time_t ;
@@ -103,6 +114,7 @@ class ColumnDateTime : public Column {
103114
104115 // / Returns element at given row number.
105116 std::time_t At (size_t n) const ;
117+ inline std::time_t operator [] (size_t n) const { return At (n); }
106118
107119 // / Timezone associated with a data column.
108120 std::string Timezone () const ;
@@ -135,7 +147,7 @@ class ColumnDateTime : public Column {
135147};
136148
137149
138- /* * */
150+ /* * DateTime64 supports date-time values of arbitrary sub-second precision, from 1900 up to 2300. */
139151class ColumnDateTime64 : public Column {
140152public:
141153 using ValueType = Int64;
@@ -152,6 +164,8 @@ class ColumnDateTime64 : public Column {
152164 // / Returns element at given row number.
153165 Int64 At (size_t n) const ;
154166
167+ inline Int64 operator [](size_t n) const { return At (n); }
168+
155169 // / Timezone associated with a data column.
156170 std::string Timezone () const ;
157171
0 commit comments