ClockWork DB CoreAPI 1.0.48
Abstract Time Series and Storage/Management Library
Loading...
Searching...
No Matches
string.hpp
1/* don't include this
2 * It is included automatically by scalar.hpp and is only
3 * separate to ease maintenance!
4 */
5
6#ifndef HAVE_TOM__STRING_HPP
7#define HAVE_TOM__STRING_HPP
8
9namespace tom {
10
11 // bring in string to the tom namespace
13
14 class String : public String_
15 {
16 public:
17
18 String() {}
19 String( const char *s ) : String_( value_type(s) ) { }
20 String( const std::string &s ) : String_( value_type(s) ) { }
21 //String( const tom::string &s ) : String_( s ) { }
22 String( tom::value_type t ) : String_(t) { }
23 ~String() { }
24
25 // Copy Constructors
26 template <typename Tp>
27 String( const scalar<Tp> &s ) : String_( s ){ }
28 String( const observation &o ) : String_( o ){ }
29
30 // Assignment Operators
31 template <typename Tp>
32 String &
33 operator=( const scalar<Tp> &s )
34 {
35 this->String_::operator=( s );
36 return *this;
37 }
38 virtual
39 String &
40 operator=( const observation &o )
41 {
42 this->String_::operator=( o );
43 return *this;
44 }
45 String &
46 operator=( const std::string &t )
47 {
48 this->String_::operator=( value_type(t) );
49 return *this;
50 }
51 String &
52 operator=( tom::value_type t )
53 {
54 this->String_::operator=(t);
55 return *this;
56 }
57 String &
58 operator=( const char *s )
59 {
60 m_value = value_type( s );
61 return *this;
62 }
63 const char *
64 c_str() const { return value().c_str(); }
65
66 size_t
67 size() const { return value().size(); }
68
69 String &
70 to_upper();
71
72 String &
73 to_lower();
74
75 // static init for String's causes a big
76 // f*ing nightmare. For now, well just
77 // use const char * which will be converted
78 // as needed in use
79 static char const * HAS_NO_DATA;
80 static char const * HOLIDAY;
81 static char const * NON_CALC;
82
83 //constexpr static char const nd_string_[] = { -2, 0x21, 0x0 };
84 //constexpr static char const na_string_[] = { -2, 0x22, 0x0 };
85 //constexpr static char const nc_string_[] = { -2, 0x23, 0x0 };
86
87 };
88
89 TOM_UTIL_API
90 String &
91 toupper( String & );
92
93 TOM_UTIL_API
94 std::string &
95 toupper( std::string & );
96
97 TOM_UTIL_API
98 String &
99 tolower( String & );
100
101 TOM_UTIL_API
102 std::string &
103 tolower( std::string & );
104
105} // end tom namespace
106
107#endif
Definition string.hpp:15
Definition observation.hpp:13
Definition scalar.hpp:19
Definition value_types.hpp:96
Definition value_types.hpp:144