]> Creatis software - cpPlugins.git/blob - lib/mstch/template_type.hpp
Moved to version 1.0
[cpPlugins.git] / lib / mstch / template_type.hpp
1 #pragma once
2
3 #include <string>
4 #include <vector>
5
6 #include "token.hpp"
7 #include "utils.hpp"
8
9 namespace mstch {
10
11 class template_type {
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 }