From f6c20ad37b2ececb446b5051837bccba93c81d7a Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 21 Jun 2017 13:05:43 +0300 Subject: Move regex utilities to libbutl --- build2/regex.cxx | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 build2/regex.cxx (limited to 'build2/regex.cxx') diff --git a/build2/regex.cxx b/build2/regex.cxx deleted file mode 100644 index d96b860..0000000 --- a/build2/regex.cxx +++ /dev/null @@ -1,42 +0,0 @@ -// file : build2/regex.cxx -*- C++ -*- -// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd -// license : MIT; see accompanying LICENSE file - -#include - -#if defined(_MSC_VER) && _MSC_VER <= 1910 -# include // strstr() -#endif - -#include -#include - -namespace std -{ - // Currently libstdc++ just returns the name of the exception (bug #67361). - // So we check that the description contains at least one space character. - // - // While VC's description is meaningful, it has an undesired prefix that - // resembles the following: 'regex_error(error_badrepeat): '. So we skip it. - // - ostream& - operator<< (ostream& o, const regex_error& e) - { - const char* d (e.what ()); - -#if defined(_MSC_VER) && _MSC_VER <= 1910 - const char* rd (strstr (d, "): ")); - if (rd != nullptr) - d = rd + 3; -#endif - - ostringstream os; - os << runtime_error (d); // Sanitize the description. - - string s (os.str ()); - if (s.find (' ') != string::npos) - o << ": " << s; - - return o; - } -} -- cgit v1.1