diff --git a/appendix.htm b/appendix.htm index b85e3105..18ae453d 100644 --- a/appendix.htm +++ b/appendix.htm @@ -20,7 +20,7 @@
Copyright (c) 1998-2000 Dr John Maddock diff --git a/changes.txt b/changes.txt index 9c8f2e31..4b653856 100644 --- a/changes.txt +++ b/changes.txt @@ -1,3 +1,7 @@ +Version 304: +FIXED: Missing this-> prefix to some symbols in cpp_regex_traits.cpp +CHANGED: Error reporting for wide character tests. +FIXED: Win2K problem with [[:unicode:]] FIXED: Signed/unsigned conversions in regex_compile.hpp and regex_format.hpp ADDED: Forwarder functions to match_results. FIXED: More errors from Como in strict mode. @@ -231,6 +235,8 @@ BUG: character sets don't function correctly when regbase::char_classes + + diff --git a/demo/jgrep/jgrep.cpp b/demo/jgrep/jgrep.cpp index 8006ca8c..18c907c8 100644 --- a/demo/jgrep/jgrep.cpp +++ b/demo/jgrep/jgrep.cpp @@ -15,7 +15,7 @@ /* * FILE jgrep.cpp - * VERSION 3.03 + * VERSION 3.04 */ #includediff --git a/demo/jgrep/jgrep.h b/demo/jgrep/jgrep.h index 61133261..7fa31daa 100644 --- a/demo/jgrep/jgrep.h +++ b/demo/jgrep/jgrep.h @@ -15,7 +15,7 @@ /* * FILE jgrep.h - * VERSION 3.03 + * VERSION 3.04 */ #ifndef _JGREP_H diff --git a/demo/jgrep/main.cpp b/demo/jgrep/main.cpp index 4181eaf5..e457e6b0 100644 --- a/demo/jgrep/main.cpp +++ b/demo/jgrep/main.cpp @@ -15,7 +15,7 @@ /* * FILE main.cpp - * VERSION 3.03 + * VERSION 3.04 */ diff --git a/demo/regress/parse.cpp b/demo/regress/parse.cpp index 13b8219b..f61b71df 100644 --- a/demo/regress/parse.cpp +++ b/demo/regress/parse.cpp @@ -16,7 +16,7 @@ /* * * FILE parse.cpp - * VERSION 3.03 + * VERSION 3.04 * * Input parsing functions for regress. * @@ -172,7 +172,7 @@ bool parse_function::operator()(const parse_grep& g) } cout << "Warning: Unknown flag: "; string_type t(i, j); - cout << t.c_str(); + cout << make_narrow(t.c_str()); cout << endl; return true; } @@ -184,9 +184,9 @@ bool parse_function::operator()(const parse_grep& g) case 1: // set the text to match: search_text = string_type(i, j); - jm_trace("Initial search text: " << search_text); + jm_trace("Initial search text: " << make_narrow(search_text)); expand_escapes(search_text); - jm_trace("Search text after escapes expanded: " << search_text); + jm_trace("Search text after escapes expanded: " << make_narrow(search_text)); break; case 2: // maybe set format string: @@ -232,8 +232,8 @@ void parse_input_line(const string_type& s) parse_function op; do_test = false; regex_grep(op, s.begin(), s.end(), parse_expression); - jm_trace("expression: " << expression); - jm_trace("search string: " << search_text); + jm_trace("expression: " << make_narrow(expression)); + jm_trace("search string: " << make_narrow(search_text)); } int to_int(string_type::const_iterator i, string_type::const_iterator j) diff --git a/demo/regress/regex_test.cpp b/demo/regress/regex_test.cpp index d58b6f29..8571f70e 100644 --- a/demo/regress/regex_test.cpp +++ b/demo/regress/regex_test.cpp @@ -16,7 +16,7 @@ /* * LOCATION: see http://www.boost.org for most recent version. * FILE regex_test.cpp - * VERSION 3.03 + * VERSION 3.04 * DESCRIPTION: Builds regression test program with default * locale and narrow character tests. Also * instantiates all the templates in the library diff --git a/demo/regress/regress.cpp b/demo/regress/regress.cpp index 5d13c7bd..90a69c99 100644 --- a/demo/regress/regress.cpp +++ b/demo/regress/regress.cpp @@ -16,7 +16,7 @@ /* * * FILE regress.cpp - * VERSION 3.03 + * VERSION 3.04 * * main() and associated code for regress. * @@ -101,7 +101,7 @@ int main(int argc, char * argv[]) string_type s; get_line(is, s); ++line; - jm_trace("Reading test script line " << line << " " << s); + jm_trace("Reading test script line " << line << " " << make_narrow(s.c_str())); parse_input_line(s); if(do_test) { @@ -117,20 +117,25 @@ int main(int argc, char * argv[]) #ifdef TEST_UNICODE -ostream& operator << (ostream& os, const wchar_t* s) +std::string make_narrow(const wchar_t* ptr) { - while(*s) + std::string result; + while(*ptr) { - os.put((char)*s); - ++s; + if(*ptr & ~0x7F) + { + char buf[10]; + std::sprintf(buf, "\\x%.4x", (int)*ptr); + result.append(buf); + ++ptr; + } + else + { + result.append(1, (char)*ptr); + ++ptr; + } } - return os; -} - -ostream& operator << (ostream& os, const std::wstring& s) -{ - os << s.c_str(); - return os; + return result; } istream& get_line(istream& is, nstring_type& s, char delim) diff --git a/demo/regress/regress.h b/demo/regress/regress.h index 14a2389b..c86260ae 100644 --- a/demo/regress/regress.h +++ b/demo/regress/regress.h @@ -16,7 +16,7 @@ /* * * FILE regress.h - * VERSION 3.03 + * VERSION 3.04 * * Function and data declarations for regress. * @@ -44,32 +44,38 @@ using std::endl; #include #if defined(TEST_UNICODE) + #ifdef __GNUC__ #define char_t wchar_t #else typedef wchar_t char_t; #endif + #define NO_POSIX_TEST typedef std::basic_string string_type; typedef std::basic_string nstring_type; inline istream& get_line(istream& is, nstring_type& s, char delim = '\n'); istream& get_line(istream& is, string_type& s, char delim = L'\n'); #define BOOST_RE_STR(x) L##x -ostream& operator << (ostream& os, const string_type& s); +std::string make_narrow(const wchar_t* ptr); +//ostream& operator << (ostream& os, const string_type& s); + +#else // TEST_UNICODE -#else #ifdef __GNUC__ #define char_t char #else typedef char char_t; #endif + typedef std::basic_string string_type; inline istream& get_line(istream& is, string_type& s, char delim = '\n'); #define BOOST_RE_STR(x) x +#define make_narrow(x) x -#endif +#endif // TEST_UNICODE -ostream& operator << (ostream& os, const wchar_t* s); +//ostream& operator << (ostream& os, const wchar_t* s); void parse_input_line(const string_type& s); void expand_escapes(string_type& s); void run_tests(); diff --git a/demo/regress/tests.cpp b/demo/regress/tests.cpp index 29bd7de8..b50a895c 100644 --- a/demo/regress/tests.cpp +++ b/demo/regress/tests.cpp @@ -16,7 +16,7 @@ /* * * FILE tests.cpp - * VERSION 3.03 + * VERSION 3.04 * * the actual tests conducted by regress. * @@ -213,7 +213,7 @@ void cpp_tests(const reg_expression & e, bool recurse = true) if(s != merge_string) { begin_error(); - cout << "merge result mismatch: found \"" << s.c_str() << "\" expected \"" << merge_string.c_str() << "\"" << endl; + cout << "merge result mismatch: found \"" << make_narrow(s.c_str()) << "\" expected \"" << make_narrow(merge_string.c_str()) << "\"" << endl; } return; } @@ -715,8 +715,8 @@ void begin_error() if(line != last_line) { cout << "Error in line " << line << " of file " << file << endl; - cout << "Expression: " << expression.c_str() << endl; - cout << "Search text: " << search_text.c_str() << endl; + cout << "Expression: " << make_narrow(expression.c_str()) << endl; + cout << "Search text: " << make_narrow(search_text.c_str()) << endl; cout << "Flags: "; bool started = false; unsigned int id = 0; @@ -726,7 +726,7 @@ void begin_error() { if(started) cout << " | "; - cout << flag_data[id].name; + cout << make_narrow(flag_data[id].name); started = true; } ++id; diff --git a/demo/regress/wregex_test.cpp b/demo/regress/wregex_test.cpp index 8488f9ad..365c7b40 100644 --- a/demo/regress/wregex_test.cpp +++ b/demo/regress/wregex_test.cpp @@ -16,7 +16,7 @@ /* * LOCATION: see http://www.boost.org for most recent version. * FILE regex_test.cpp - * VERSION 3.03 + * VERSION 3.04 * DESCRIPTION: Builds regression test program with default * locale and wide character tests. Also * instantiates all the templates in the library diff --git a/faq.htm b/faq.htm index 0739852b..56a1b7a1 100644 --- a/faq.htm +++ b/faq.htm @@ -20,7 +20,7 @@ Regex++, FAQ.
-(version 3.03, 18 April 2000) +(version 3.04, 18 April 2000) Copyright (c) 1998-2000 Dr John Maddock diff --git a/format_string.htm b/format_string.htm index 115236e1..8752f948 100644 --- a/format_string.htm +++ b/format_string.htm @@ -20,7 +20,7 @@Regex++, Format String Reference.
-(version 3.03, 18 April 2000) +(version 3.04, 18 April 2000) Copyright (c) 1998-2000 Dr John Maddock diff --git a/hl_ref.htm b/hl_ref.htm index 2da75f14..a453a242 100644 --- a/hl_ref.htm +++ b/hl_ref.htm @@ -20,7 +20,7 @@ content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">Regex++, RegEx Class Reference.
-(version 3.03, 18 April 2000)
+(version 3.04, 18 April 2000)
Copyright (c) 1998-2000 Dr John Maddock diff --git a/include/boost/cregex.hpp b/include/boost/cregex.hpp index 0edef1ba..3d25e256 100644 --- a/include/boost/cregex.hpp +++ b/include/boost/cregex.hpp @@ -16,7 +16,7 @@ /* * LOCATION: see http://www.boost.org for most recent version. * FILE cregex.cpp - * VERSION 3.03 + * VERSION 3.04 * DESCRIPTION: Declares POSIX API functions * + boost::RegEx high level wrapper. */ diff --git a/include/boost/re_detail/fileiter.hpp b/include/boost/re_detail/fileiter.hpp index 1eb337ad..442330c2 100644 --- a/include/boost/re_detail/fileiter.hpp +++ b/include/boost/re_detail/fileiter.hpp @@ -16,7 +16,7 @@ /* * LOCATION: see http://www.boost.org for most recent version. * FILE fileiter.hpp - * VERSION 3.03 + * VERSION 3.04 * DESCRIPTION: Declares various platform independent file and * directory iterators, plus binary file input in * the form of class map_file. diff --git a/include/boost/re_detail/regex_compile.hpp b/include/boost/re_detail/regex_compile.hpp index 36996069..3906f6dc 100644 --- a/include/boost/re_detail/regex_compile.hpp +++ b/include/boost/re_detail/regex_compile.hpp @@ -16,7 +16,7 @@ /* * LOCATION: see http://www.boost.org for most recent version. * FILE regex_compile.hpp - * VERSION 3.03 + * VERSION 3.04 * DESCRIPTION: Declares reg_expression<> member functions. This is * an internal header file, do not include directly. */ diff --git a/include/boost/re_detail/regex_config.hpp b/include/boost/re_detail/regex_config.hpp index a74a267e..616f6174 100644 --- a/include/boost/re_detail/regex_config.hpp +++ b/include/boost/re_detail/regex_config.hpp @@ -16,7 +16,7 @@ /* * LOCATION: see http://www.boost.org for most recent version. * FILE regex_config.hpp - * VERSION 3.03 + * VERSION 3.04 * DESCRIPTION: auto-configure options for regular expression code. */ @@ -319,25 +319,40 @@ Do not change this file unless you really really have to, add options to #define BOOST_RE_NO_TEMPLATE_FRIEND #endif -#ifdef __HP_aCC +#if defined(__HP_aCC) || defined(__hpux) // putative HP aCC support, run configure for // support tailored to your system.... +# if (__HP_aCC < 31400) + // non-conformant aCC: #define BOOST_RE_NO_NAMESPACES #define BOOST_RE_NO_MUTABLE - #define BOOST_RE_NO_MEMBER_TEMPLATES #define BOOST_RE_OLD_IOSTREAM #ifndef __STL_USE_NAMESPACES #define BOOST_RE_NO_EXCEPTION_H #endif - #define BOOST_RE_INT64t long long - #define BOOST_RE_IMM64(val) val##LL #define BOOST_RE_NESTED_TEMPLATE_DECL #define BOOST_RE_NO_TEMPLATE_FRIEND +#else + #if !defined(_NAMESPACE_STD) + #define BOOST_RE_OLD_IOSTREAM + #ifndef __STL_USE_NAMESPACES + #define BOOST_RE_NO_EXCEPTION_H + #endif + #endif + #define BOOST_RE_NESTED_TEMPLATE_DECL template +#endif + #define BOOST_RE_NO_MEMBER_TEMPLATES + #define BOOST_RE_NO_MEMORY_H + #define BOOST_RE_INT64t long long + #define BOOST_RE_IMM64(val) val##LL #define BOOST_RE_NO_SWPRINTF + #define BOOST_RE_NO_CAT #endif #ifdef __sgi // SGI IRIX C++ #define BOOST_RE_NO_SWPRINTF +// bring in stl version: +#include#if defined(__SGI_STL_PORT) // STLPort on IRIX is misconfigured: does not compile // as a temporary fix include instead and prevent inclusion @@ -504,7 +519,7 @@ typedef unsigned long jm_uintfast32_t; //#define BOOST_RE_NO_NOT_EQUAL #endif - #elif defined(_RWSTD_VER) + #elif defined(_RWSTD_VER) || defined(__STD_ITERATOR__) /* Rogue Wave STL */ // Sometimes we have a four figure version number, sometimes a @@ -575,7 +590,7 @@ typedef unsigned long jm_uintfast32_t; #include - #ifdef _RWSTD_ALLOCATOR + #if defined(_RWSTD_ALLOCATOR) && !defined(BOOST_RE_NO_MEMORY_H) && !defined(BOOST_RE_NO_MEMBER_TEMPLATES) /* new style allocator */ @@ -636,9 +651,9 @@ typedef unsigned long jm_uintfast32_t; #define BOOST_RE_STL_DONE - #elif defined (BOOST_MSVC) + #elif (defined(BOOST_MSVC) || defined(__ICL)) && (defined(_YVALS) || defined(_CPPLIB_VER)) - /* assume we're using MS's own STL (VC++ 5/6) */ + /* VC6 or Intel C++, with Dinkum STL */ #define BOOST_RE_NO_OI_ASSIGN #define BOOST_RE_DISTANCE(i, j, n) n = std::distance(i, j) diff --git a/include/boost/re_detail/regex_cstring.hpp b/include/boost/re_detail/regex_cstring.hpp index 5e34e97b..55b952fe 100644 --- a/include/boost/re_detail/regex_cstring.hpp +++ b/include/boost/re_detail/regex_cstring.hpp @@ -16,7 +16,7 @@ /* * LOCATION: see http://www.boost.org for most recent version. * FILE regex_cstring.hpp - * VERSION 3.03 + * VERSION 3.04 * DESCRIPTION: This is an internal header file, do not include directly. * String support and helper functions, for regular * expression library. diff --git a/include/boost/re_detail/regex_format.hpp b/include/boost/re_detail/regex_format.hpp index 8930ae9b..82bb52af 100644 --- a/include/boost/re_detail/regex_format.hpp +++ b/include/boost/re_detail/regex_format.hpp @@ -16,7 +16,7 @@ /* * LOCATION: see http://www.boost.org for most recent version. * FILE regex_format.hpp - * VERSION 3.03 + * VERSION 3.04 * DESCRIPTION: Provides formatting output routines for search and replace * operations. Note this is an internal header file included * by regex.hpp, do not include on its own. diff --git a/include/boost/re_detail/regex_kmp.hpp b/include/boost/re_detail/regex_kmp.hpp index 0f70c7dc..74ed3aaf 100644 --- a/include/boost/re_detail/regex_kmp.hpp +++ b/include/boost/re_detail/regex_kmp.hpp @@ -16,7 +16,7 @@ /* * LOCATION: see http://www.boost.org for most recent version. * FILE regex_kmp.hpp - * VERSION 3.03 + * VERSION 3.04 * DESCRIPTION: Provides Knuth Morris Pratt search operations. * Note this is an internal header file included * by regex.hpp, do not include on its own. diff --git a/include/boost/re_detail/regex_library_include.hpp b/include/boost/re_detail/regex_library_include.hpp index dbe78566..9e5c8514 100644 --- a/include/boost/re_detail/regex_library_include.hpp +++ b/include/boost/re_detail/regex_library_include.hpp @@ -16,7 +16,7 @@ /* * LOCATION: see http://www.boost.org for most recent version. * FILE regex_libary_include.hpp - * VERSION 3.03 + * VERSION 3.04 * DESCRIPTION: Automatic library inclusion for Borland/Microsoft compilers. * Note this is an internal header file included * by regex.hpp, do not include on its own. diff --git a/include/boost/re_detail/regex_match.hpp b/include/boost/re_detail/regex_match.hpp index 47cbee66..7c7535fc 100644 --- a/include/boost/re_detail/regex_match.hpp +++ b/include/boost/re_detail/regex_match.hpp @@ -16,7 +16,7 @@ /* * LOCATION: see http://www.boost.org for most recent version. * FILE regex_match.hpp - * VERSION 3.03 + * VERSION 3.04 * DESCRIPTION: Regular expression matching algorithms. * Note this is an internal header file included * by regex.hpp, do not include on its own. diff --git a/include/boost/re_detail/regex_raw_buffer.hpp b/include/boost/re_detail/regex_raw_buffer.hpp index 9df15aed..552d7512 100644 --- a/include/boost/re_detail/regex_raw_buffer.hpp +++ b/include/boost/re_detail/regex_raw_buffer.hpp @@ -16,7 +16,7 @@ /* * LOCATION: see http://www.boost.org for most recent version. * FILE regex_raw_buffer.hpp - * VERSION 3.03 + * VERSION 3.04 * DESCRIPTION: Raw character buffer for regex code. * Note this is an internal header file included * by regex.hpp, do not include on its own. @@ -109,9 +109,9 @@ class raw_storage { public: typedef Allocator allocator_type; - typedef typename REBIND_TYPE(unsigned char, allocator_type)::size_type size_type; typedef BOOST_RE_MAYBE_TYPENAME REBIND_TYPE(unsigned char, allocator_type) alloc_inst_type; - typedef typename REBIND_TYPE(unsigned char, allocator_type)::pointer pointer; + typedef typename alloc_inst_type::size_type size_type; + typedef typename alloc_inst_type::pointer pointer; private: // // empty member optimisation: diff --git a/include/boost/re_detail/regex_split.hpp b/include/boost/re_detail/regex_split.hpp index 72d5be07..df67931d 100644 --- a/include/boost/re_detail/regex_split.hpp +++ b/include/boost/re_detail/regex_split.hpp @@ -16,7 +16,7 @@ /* * LOCATION: see http://www.boost.org for most recent version. * FILE regex_split.hpp - * VERSION 3.03 + * VERSION 3.04 * DESCRIPTION: Implements regex_split and associated functions. * Note this is an internal header file included * by regex.hpp, do not include on its own. diff --git a/include/boost/re_detail/regex_stack.hpp b/include/boost/re_detail/regex_stack.hpp index 9cf8b8e3..0cd4b585 100644 --- a/include/boost/re_detail/regex_stack.hpp +++ b/include/boost/re_detail/regex_stack.hpp @@ -16,7 +16,7 @@ /* * LOCATION: see http://www.boost.org for most recent version. * FILE regex_stack.hpp - * VERSION 3.03 + * VERSION 3.04 * DESCRIPTION: Implements customised internal regex stacks. * Note this is an internal header file included * by regex.hpp, do not include on its own. @@ -53,7 +53,8 @@ class jstack { private: typedef BOOST_RE_MAYBE_TYPENAME REBIND_TYPE(unsigned char, Allocator) allocator_type; - typedef typename REBIND_TYPE(T, Allocator)::size_type size_type; + typedef BOOST_RE_MAYBE_TYPENAME REBIND_TYPE(T, Allocator) T_alloc_type; + typedef typename T_alloc_type::size_type size_type; typedef T value_type; struct node { diff --git a/include/boost/re_detail/regex_synch.hpp b/include/boost/re_detail/regex_synch.hpp index f9c61124..25e324b2 100644 --- a/include/boost/re_detail/regex_synch.hpp +++ b/include/boost/re_detail/regex_synch.hpp @@ -16,7 +16,7 @@ /* * LOCATION: see http://www.boost.org for most recent version. * FILE regex_synch.hpp - * VERSION 3.03 + * VERSION 3.04 * DESCRIPTION: Thread synchronisation for regex code. * Note this is an internal header file included * by regex.hpp, do not include on its own. diff --git a/include/boost/regex.h b/include/boost/regex.h index 79af8ba8..0c4aff9e 100644 --- a/include/boost/regex.h +++ b/include/boost/regex.h @@ -16,7 +16,7 @@ /* * LOCATION: see http://www.boost.org for most recent version. * FILE regex.h - * VERSION 3.03 + * VERSION 3.04 * DESCRIPTION: Declares POSIX API functions */ diff --git a/include/boost/regex.hpp b/include/boost/regex.hpp index 070abda8..092b4e8b 100644 --- a/include/boost/regex.hpp +++ b/include/boost/regex.hpp @@ -16,7 +16,7 @@ /* * LOCATION: see http://www.boost.org for most recent version. * FILE regex.cpp - * VERSION 3.03 + * VERSION 3.04 * DESCRIPTION: Declares boost::reg_expression<> and associated * functions and classes. This header is the main * entry point for the template regex code. @@ -836,7 +836,8 @@ class match_results_base { public: typedef Allocator alloc_type; - typedef typename REBIND_TYPE(iterator, Allocator)::size_type size_type; + typedef BOOST_RE_MAYBE_TYPENAME REBIND_TYPE(iterator, Allocator) iterator_alloc; + typedef iterator_alloc::size_type size_type; #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION typedef typename std::iterator_traits ::difference_type difference_type; typedef typename std::iterator_traits ::value_type char_type; diff --git a/include/boost/regex_traits.hpp b/include/boost/regex_traits.hpp index 09a4af99..b1af9b1a 100644 --- a/include/boost/regex_traits.hpp +++ b/include/boost/regex_traits.hpp @@ -16,7 +16,7 @@ /* * LOCATION: see http://www.boost.org for most recent version. * FILE regex.cpp - * VERSION 3.03 + * VERSION 3.04 * DESCRIPTION: Declares regular expression traits classes. */ diff --git a/index.htm b/index.htm index 8e5d8f07..c2f4b818 100644 --- a/index.htm +++ b/index.htm @@ -23,7 +23,7 @@ content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot"> Regex++, Index.
-(version 3.03, 18 April 2000)
+(version 3.04, 18 April 2000)
Copyright (c) 1998-2000 Dr John Maddock diff --git a/introduction.htm b/introduction.htm index 151add82..9c2995da 100644 --- a/introduction.htm +++ b/introduction.htm @@ -23,7 +23,7 @@ content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">Regex++, Introduction.
-(version 3.03, 18 April 2000)
+(version 3.04, 18 April 2000)
Copyright (c) 1998-2000 Dr John Maddock @@ -207,7 +207,7 @@ packages, and to a more limited extent perl 5. Configuration OptionsRegex++, Template Class and Algorithm Reference.
-(version 3.03, 18 April 2000)
+(version 3.04, 18 April 2000)
Copyright (c) 1998-9 Dr John Maddock diff --git a/traits_class_ref.htm b/traits_class_ref.htm index 537b1bb7..8efa4f61 100644 --- a/traits_class_ref.htm +++ b/traits_class_ref.htm @@ -19,7 +19,7 @@ HEIGHT="86" ALT="C++ Boost">Regex++, Traits Class -Reference. (version 3.03, 18 April 2000)
+Reference. (version 3.04, 18 April 2000)Copyright (c) 1998-2000 Dr John Maddock