From 8e761289a2446367267c6c0d9a26e734f0f78306 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 16 Dec 2020 20:29:05 +0300 Subject: Get rid of legacy build systems and rename cutl/ to libcutl/ --- cutl/re/re.txx | 68 ---------------------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 cutl/re/re.txx (limited to 'cutl/re/re.txx') diff --git a/cutl/re/re.txx b/cutl/re/re.txx deleted file mode 100644 index 95829a8..0000000 --- a/cutl/re/re.txx +++ /dev/null @@ -1,68 +0,0 @@ -// file : cutl/re/re.txx -// license : MIT; see accompanying LICENSE file - -namespace cutl -{ - namespace re - { - // - // basic_regexsub - // - template - void basic_regexsub:: - init (string_type const& s) - { - string_type r; - typename string_type::size_type p (parse (s, 0, r)); - regex_ = r; - p = parse (s, p, sub_); - if (p + 1 < s.size ()) - throw basic_format (s, "junk after third delimiter"); - } - - // - // parse() - // - template - typename std::basic_string::size_type - parse (std::basic_string const& s, - typename std::basic_string::size_type p, - std::basic_string& r) - { - r.clear (); - typename std::basic_string::size_type n (s.size ()); - - if (p >= n) - throw basic_format (s, "empty expression"); - - char d (s[p++]); - - for (; p < n; ++p) - { - if (s[p] == d) - break; - - if (s[p] == '\\') - { - if (++p < n) - { - // Pass the escape sequence through unless it is the delimiter. - // - if (s[p] != d) - r += '\\'; - - r += s[p]; - } - // else {We ran out of stuff before finding the delimiter.} - } - else - r += s[p]; - } - - if (p == n) - throw basic_format (s, "missing closing delimiter"); - - return p; - } - } -} -- cgit v1.1