ClockWork DB CoreAPI 1.0.48
Abstract Time Series and Storage/Management Library
Loading...
Searching...
No Matches
date_parser.hpp
1#ifndef CSV_DATEPARSER_H
2#define CSV_DATEPARSER_H
3
4#ifdef WIN32
5#pragma warning(disable: 4786)
6#endif
7
8#include <tom-util/scalar.hpp>
9#include <boost/tokenizer.hpp>
10#include <boost/algorithm/string.hpp>
11#include <map>
12#include <vector>
13
14namespace tom {
15
17 {
18 public:
19 enum part { YEAR, MONTH, DAY, DATE_PART_COUNT };
20
21 virtual
22 ~date_parser () { }
23
24 virtual
26 operator()( const std::string & s ) = 0;
27
28 };
29
31 {
32 typedef std::pair<const std::string, date_parser * > parser_pair_t;
33 typedef std::map<std::string, date_parser *, std::less<const std::string> > parser_map_t;
34
35 //typedef std::map< std::string, date_parser *> parser_map_t;
36
37 static const unsigned char DELIMITED = 1 << 0;
38 static const unsigned char FIXED_WIDTH = 0 << 0;
39 static const unsigned char MONTH_TEXT = 1 << 1;
40 static const unsigned char NO_MONTH_TEXT = 0 << 1;
41
42 public:
43 static
45 get_date_parser( const std::string &date_image );
46
47 private:
49
50 static
51 parser_map_t *
52 get_parser_map( );
53
54 static
56 build_date_parser( const std::string &date_image );
57
58// static
59// date_image_map_t *
60// get_date_image_map( );
61 };
62
63
64
65
66} // end tom namespace
67
68#endif // CSV_DATEPARSER_H
Definition calendar.hpp:47
Definition date_parser.hpp:31
Definition date_parser.hpp:17