X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Fmstch%2Ftemplate_type.hpp;fp=lib%2Fmstch%2Ftemplate_type.hpp;h=3c5bf91e6debccd3bf017dc6caed1701ccbc9427;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=0000000000000000000000000000000000000000;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/lib/mstch/template_type.hpp b/lib/mstch/template_type.hpp new file mode 100644 index 0000000..3c5bf91 --- /dev/null +++ b/lib/mstch/template_type.hpp @@ -0,0 +1,30 @@ +#pragma once + +#include +#include + +#include "token.hpp" +#include "utils.hpp" + +namespace mstch { + +class template_type { + public: + template_type() = default; + template_type(const std::string& str); + template_type(const std::string& str, const delim_type& delims); + std::vector::const_iterator begin() const { return m_tokens.begin(); } + std::vector::const_iterator end() const { return m_tokens.end(); } + void operator<<(const token& token) { m_tokens.push_back(token); } + + private: + std::vector m_tokens; + std::string m_open; + std::string m_close; + void strip_whitespace(); + void process_text(citer beg, citer end); + void tokenize(const std::string& tmp); + void store_prefixes(std::vector::iterator beg); +}; + +}