Electroneum
template_type.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
6 #include "token.hpp"
7 #include "utils.hpp"
8 
9 namespace mstch {
10 
12  public:
13  template_type() = default;
14  template_type(const std::string& str);
15  template_type(const std::string& str, const delim_type& delims);
16  std::vector<token>::const_iterator begin() const { return m_tokens.begin(); }
17  std::vector<token>::const_iterator end() const { return m_tokens.end(); }
18  void operator<<(const token& token) { m_tokens.push_back(token); }
19 
20  private:
21  std::vector<token> m_tokens;
22  std::string m_open;
23  std::string m_close;
24  void strip_whitespace();
25  void process_text(citer beg, citer end);
26  void tokenize(const std::string& tmp);
27  void store_prefixes(std::vector<token>::iterator beg);
28 };
29 
30 }
std::string m_close
Definition: template_type.hpp:23
void operator<<(const token &token)
Definition: template_type.hpp:18
std::string m_open
Definition: template_type.hpp:22
void strip_whitespace()
Definition: template_type.cpp:71
Definition: mstch.hpp:11
void tokenize(const std::string &tmp)
Definition: template_type.cpp:30
Definition: template_type.hpp:11
std::string::const_iterator citer
Definition: utils.hpp:8
std::vector< token >::const_iterator end() const
Definition: template_type.hpp:17
std::pair< std::string, std::string > delim_type
Definition: token.hpp:7
Definition: token.hpp:9
void process_text(citer beg, citer end)
Definition: template_type.cpp:19
std::vector< token > m_tokens
Definition: template_type.hpp:21
void store_prefixes(std::vector< token >::iterator beg)
Definition: template_type.cpp:99
std::vector< token >::const_iterator begin() const
Definition: template_type.hpp:16