#pragma once #include #include typedef std::function template_cb; class TemplateString : public std::stringstream { public: static void registerTemplateCallback(const char *variable, template_cb cb, void *user_ptr = NULL, bool recursive = false) { TemplateString::template_callbacks[std::string(variable)] = std::pair>(cb, std::pair(recursive, user_ptr)); } std::string doTemplateStr(); private: std::string in_cache, out_cache; static std::map>> template_callbacks; };