vega
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
time.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <memory>
5 #include <regex>
6 
7 namespace vega {
8  class RegexString;
9 
23  class Time {
24  public:
25  static const std::shared_ptr<const std::regex> SINGLE_TIME_REGEX;
26  static const std::shared_ptr<const std::regex> TIME_RANGE_REGEX;
27 
28  // Can either be single Time
29  std::shared_ptr<const RegexString> m_time;
30  // Or a range of Times
31  std::shared_ptr<const Time> m_lower;
32  std::shared_ptr<const Time> m_upper;
33 
34  public:
35  explicit Time(const std::string& s);
36  Time(const std::shared_ptr<Time>& lower, const std::shared_ptr<Time>& upper);
37 
38  bool is_range() const;
39  const std::shared_ptr<const Time>& lower() const;
40  const std::shared_ptr<const Time>& upper() const;
41 
42  bool operator==(const Time& other) const;
43  bool operator!=(const Time& other) const;
44 
45  std::string str() const;
46  void set_string(const std::string& s);
47  };
48 }
static const std::shared_ptr< const std::regex > TIME_RANGE_REGEX
Definition: time.h:26
const std::shared_ptr< const Time > & lower() const
A class which wraps a Time type (VR of vr::TM).
Definition: time.h:23
Time(const std::string &s)
const std::shared_ptr< const Time > & upper() const
bool operator!=(const Time &other) const
std::string str() const
std::shared_ptr< const Time > m_lower
Definition: time.h:31
void set_string(const std::string &s)
std::shared_ptr< const Time > m_upper
Definition: time.h:32
Definition: age.h:6
bool is_range() const
bool operator==(const Time &other) const
static const std::shared_ptr< const std::regex > SINGLE_TIME_REGEX
Definition: time.h:25
std::shared_ptr< const RegexString > m_time
Definition: time.h:29