-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathnull.hpp
More file actions
58 lines (50 loc) · 1.42 KB
/
null.hpp
File metadata and controls
58 lines (50 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
* \file cppsas7bdat/sink/null.hpp
*
* \brief NULL datasink
*
* \author Olivia Quinet
*/
#ifndef _CPP_SAS7BDAT_SINK_NULL_HPP_
#define _CPP_SAS7BDAT_SINK_NULL_HPP_
#include <cppsas7bdat/column.hpp>
#include <cppsas7bdat/properties.hpp>
namespace cppsas7bdat {
namespace datasink {
struct null {
COLUMNS columns;
void set_properties([[maybe_unused]] const Properties &_properties) {
columns = COLUMNS(_properties /*.metadata*/.columns);
}
void push_row([[maybe_unused]] const size_t _irow,
[[maybe_unused]] Column::PBUF _p) {
for (const auto &column : columns) {
switch (column.type) {
case cppsas7bdat::Column::Type::string:
process(column.get_string(_p));
break;
case cppsas7bdat::Column::Type::integer:
process(column.get_integer(_p));
break;
case cppsas7bdat::Column::Type::number:
process(column.get_number(_p));
break;
case cppsas7bdat::Column::Type::datetime:
process(column.get_datetime(_p));
break;
case cppsas7bdat::Column::Type::date:
process(column.get_date(_p));
break;
case cppsas7bdat::Column::Type::time:
process(column.get_time(_p));
break;
}
}
}
template <typename _Tp>
void process([[maybe_unused]] const _Tp _x) const noexcept {}
void end_of_data() const noexcept {}
};
} // namespace datasink
} // namespace cppsas7bdat
#endif