]> Creatis software - cpPlugins.git/blobdiff - lib/mstch/utils.hpp
Moved to version 1.0
[cpPlugins.git] / lib / mstch / utils.hpp
diff --git a/lib/mstch/utils.hpp b/lib/mstch/utils.hpp
new file mode 100644 (file)
index 0000000..9041a3e
--- /dev/null
@@ -0,0 +1,23 @@
+#pragma once
+
+#include <string>
+#include <boost/variant/apply_visitor.hpp>
+
+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<class... Args>
+auto visit(Args&&... args) -> decltype(boost::apply_visitor(
+    std::forward<Args>(args)...))
+{
+  return boost::apply_visitor(std::forward<Args>(args)...);
+}
+
+}