diff options
Diffstat (limited to 'libbutl/regex.ixx')
-rw-r--r-- | libbutl/regex.ixx | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/libbutl/regex.ixx b/libbutl/regex.ixx index dec15d1..08962cf 100644 --- a/libbutl/regex.ixx +++ b/libbutl/regex.ixx @@ -1,7 +1,9 @@ // file : libbutl/regex.ixx -*- C++ -*- // license : MIT; see accompanying LICENSE file -LIBBUTL_MODEXPORT namespace butl //@@ MOD Clang needs this for some reason. +#include <utility> // move(), make_pair() + +namespace butl { template <typename C> inline std::pair<std::basic_string<C>, bool> @@ -21,4 +23,30 @@ LIBBUTL_MODEXPORT namespace butl //@@ MOD Clang needs this for some reason. return make_pair (move (r), match); } + + template <typename C> + inline std::pair<std::basic_regex<C>, std::basic_string<C>> + regex_replace_parse (const std::basic_string<C>& s, + std::regex_constants::syntax_option_type f) + { + return regex_replace_parse (s.c_str (), s.size (), f); + } + + template <typename C> + inline std::pair<std::basic_regex<C>, std::basic_string<C>> + regex_replace_parse (const C* s, + std::regex_constants::syntax_option_type f) + { + return regex_replace_parse ( + s, std::basic_string<C>::traits_type::length (s), f); + } + + template <typename C> + inline std::basic_string<C> + regex_replace_match_results ( + const std::match_results<typename std::basic_string<C>::const_iterator>& m, + const std::basic_string<C>& fmt) + { + return regex_replace_match_results (m, fmt.c_str (), fmt.size ()); + } } |