X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Fmstch%2Futils.hpp;fp=lib%2Fmstch%2Futils.hpp;h=9041a3eda1783e0a8db62a4e05f27af5b285e705;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=0000000000000000000000000000000000000000;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/lib/mstch/utils.hpp b/lib/mstch/utils.hpp new file mode 100644 index 0000000..9041a3e --- /dev/null +++ b/lib/mstch/utils.hpp @@ -0,0 +1,23 @@ +#pragma once + +#include +#include + +namespace mstch { + +using citer = std::string::const_iterator; +using criter = std::string::const_reverse_iterator; + +citer first_not_ws(citer begin, citer end); +citer first_not_ws(criter begin, criter end); +std::string html_escape(const std::string& str); +criter reverse(citer it); + +template +auto visit(Args&&... args) -> decltype(boost::apply_visitor( + std::forward(args)...)) +{ + return boost::apply_visitor(std::forward(args)...); +} + +}