Compare commits

..

20 Commits

Author SHA1 Message Date
873a20cc80 This commit was manufactured by cvs2svn to create tag
'Version_1_26_0'.

[SVN r11842]
2001-11-30 18:24:42 +00:00
f0d62fb2c0 Updated changes log
[SVN r11830]
2001-11-30 12:00:31 +00:00
7104418bd5 * Changed BOOST_RE_THREADS to BOOST_HAS_THREADS,
* Updated allocator code to use SGI node based allocator when available.


[SVN r11829]
2001-11-30 11:58:04 +00:00
0bd54d3821 Added optional code to time how long the test takes.
[SVN r11828]
2001-11-30 11:56:35 +00:00
c167b1f183 changed BOOST_RE_THREADS to BOOST_HAS_THREADS
[SVN r11827]
2001-11-30 11:56:02 +00:00
52920ff98f Added \ as a non-literal character (oversight).
[SVN r11717]
2001-11-16 12:25:17 +00:00
72c3b4ed13 Fix for broken split (doesn't spit out all sub expressions).
[SVN r11716]
2001-11-16 12:24:40 +00:00
6cc5cf41d5 Trivial fix for signed/unsigned comparison
[SVN r11715]
2001-11-16 12:24:01 +00:00
a7984bb149 Updated Jamfiles with forced dynamic linking removed.
[SVN r11647]
2001-11-10 12:12:38 +00:00
876ff39307 remove redundant <runtime-link>dynamic from default-BUILD section
[SVN r11644]
2001-11-09 15:30:45 +00:00
79f80ad09d Updated list of helpers
[SVN r11449]
2001-10-26 11:58:59 +00:00
19d8e96cf5 Added workaround for Rogue Wave lib bug.
[SVN r11391]
2001-10-16 11:36:47 +00:00
e047b2b509 Updated examples with better comment on expressions. Updated test program to test for apparent Rogur Wave bug (and it's workaround).
[SVN r11390]
2001-10-16 11:36:00 +00:00
28968bd2b6 renamed "free" member functions to avoid conflicts with system macros.
[SVN r11384]
2001-10-13 10:26:34 +00:00
c4b295684b Added docs for smatch and wsmatch typedefs, added warnings about using temporaries with regex_search/regex_match.
[SVN r11383]
2001-10-13 10:24:55 +00:00
33b6eb0637 Renamed member functions "free" to prevent conflict with system macro.
[SVN r11380]
2001-10-13 10:19:01 +00:00
de9ad8df74 Fix spelling error: "occurances" -> "occurrences".
[SVN r11376]
2001-10-11 17:26:04 +00:00
a042a0b6de Removed spurious MSVC pragma
[SVN r11369]
2001-10-09 11:25:43 +00:00
f16f300347 Fixed inclusion of windows.h
[SVN r11356]
2001-10-08 11:32:22 +00:00
a543dce5e3 regex, threads, and python will all build from the top level. If you build the 'test' target from the top level, it will run all regressions.
Jamfile:
  subincludes for thread, python libs, and status for regression tests

Jamrules:
  Use the new path-global rule to establish BOOST_ROOT correctly for all subprojects

libs/regex/build/Jamfile
  Take advantage of correct BOOST_ROOT setting

libs/python/build/Jamfile
  Search for python executable; don't try to build anything if it can't be found.
  don't build tests by default
  improved comments, organization, and naming.

status/Jamfile
  Fixed references to config test files
  Failed tests now leave their stdout results in <testname>.error instead of removing it
  No test targets are dependencies of 'all' anymore
  Added comments
  Reorganized

tools/build/Jambase
  Meant to check this in long ago.

tools/build/allyourbase.jam
  Fixed SHELL_EXPORT setting, added SHELL_SET
  removed 'test' from the dependencies of 'all'; tests no longer run by default.
  Fixed the direction of slashes for Windows when ALL_LOCATE_TARGET is used.
  Added path-global rule for declaring path variables which may be relative
  rule in-invocation-subdir returns true if the current subproject is the one
     from which Jam was invoked
  rule protect-subdir is now used to protect subproject variables
  rule tokens-to-simple-path converts path tokens to a simplified path.

tools/build/boost-base.jam
  Fixed bugs

tools/build/jam_src/makedebugjam.bat
  Fixed a bug which prevented a final debug build

tools/build/jam_src/search.c
  Fixed a bug of mine which caused LOCATE to be ignored (!).


[SVN r11348]
2001-10-06 18:19:15 +00:00
27 changed files with 276 additions and 122 deletions

View File

@ -1295,21 +1295,22 @@ for forcing me to think about algorithms and their performance,
and to the folks at boost for forcing me to <i>think</i>, period.
The following people have all contributed useful comments or
fixes: Dave Abrahams, Mike Allison, Edan Ayal, Jayashree
Balasubramanian, Beman Dawes, Paul Baxter, David Bergman, David
Dennerline, Edward Diener, Peter Dimov, Robert Dunn, Fabio Forno,
Tobias Gabrielsson, Rob Gillen, Marc Gregoire, Chris Hecker, Nick
Hodapp, Jesse Jones, Martin Jost, Boris Krasnovskiy, Jan
Hermelink, Max Leung, Wei-hao Lin, Jens Maurer, Heiko Schmidt,
Jason Shirk, Scobie Smith, Alexander Sokolovsky, Herv<72> Poirier,
Marc Recht, Bruno Voigt, Alexey Voinov, Jerry Waldorf, Rob Ward,
Lealon Watts, Thomas Witt and Yuval Yosef. I am also grateful to
the manuals supplied with the Henry Spencer, Perl and GNU regular
expression libraries - wherever possible I have tried to maintain
compatibility with these libraries and with the POSIX standard -
the code however is entirely my own, including any bugs! I can
absolutely guarantee that I will not fix any bugs I don't know
about, so if you have any comments or spot any bugs, please get
in touch. </p>
Balasubramanian, Jan B<>lsche, Beman Dawes, Paul Baxter, David
Bergman, David Dennerline, Edward Diener, Peter Dimov, Robert
Dunn, Fabio Forno, Tobias Gabrielsson, Rob Gillen, Marc Gregoire,
Chris Hecker, Nick Hodapp, Jesse Jones, Martin Jost, Boris
Krasnovskiy, Jan Hermelink, Max Leung, Wei-hao Lin, Jens Maurer,
Richard Peters, Heiko Schmidt, Jason Shirk, Gerald Slacik, Scobie
Smith, Mike Smyth, Alexander Sokolovsky, Herv<EFBFBD> Poirier, Michael
Raykh, Marc Recht, Scott VanCamp, Bruno Voigt, Alexey Voinov,
Jerry Waldorf, Rob Ward, Lealon Watts, Thomas Witt and Yuval
Yosef. I am also grateful to the manuals supplied with the Henry
Spencer, Perl and GNU regular expression libraries - wherever
possible I have tried to maintain compatibility with these
libraries and with the POSIX standard - the code however is
entirely my own, including any bugs! I can absolutely guarantee
that I will not fix any bugs I don't know about, so if you have
any comments or spot any bugs, please get in touch. </p>
<p>Useful further information can be found at: </p>

View File

@ -5,23 +5,21 @@ SOURCES = c_regex_traits c_regex_traits_common cpp_regex_traits
regex_synch w32_regex_traits wide_posix_api ;
lib libboost_regex$(SUFLIB) : ../src/$(SOURCES).cpp
:
<include>../../../
<define>BOOST_RE_NO_LIB=1
:
debug release
<runtime-link>dynamic
;
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug release
;
dll libboost_regex$(SUFDLL[1]) : ../src/$(SOURCES).cpp
:
<include>../../../
<define>BOOST_RE_BUILD_DLL=1
:
debug release
<runtime-link>dynamic
;
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_BUILD_DLL=1
:
debug release
;

View File

@ -1,4 +1,11 @@
Version 331:
FIXED: All known current bugs.
ADDED: Support for default SGI allocator when available (even if it's not
standard conformant).
Version 330:
BUG: Not all occurances of BOOST_RE_THREADS changed to use BOOST_HAS_THREADS
CHANGED: Completely redesigned config support (now fully integrated with boost).
FIXED: Support for building with _UNICODE defined.
FIXED: Bug when running on Windows XP (character classification bitmaps wrong).
@ -269,5 +276,6 @@ BUG: character sets don't function correctly when regbase::char_classes

View File

@ -8,7 +8,6 @@ exe timer : timer/regex_timer.cpp
<define>BOOST_REGEX_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe jgrep : jgrep/jgrep.cpp jgrep/main.cpp
@ -18,7 +17,6 @@ exe jgrep : jgrep/jgrep.cpp jgrep/main.cpp
<define>BOOST_REGEX_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe credit_card_example : snippets/credit_card_example.cpp
@ -28,7 +26,6 @@ exe credit_card_example : snippets/credit_card_example.cpp
<define>BOOST_REGEX_NO_LIB=1
:
debug
<runtime-link>dynamic
;
@ -39,7 +36,6 @@ exe partial_regex_grep : snippets/partial_regex_grep.cpp
<define>BOOST_REGEX_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe partial_regex_match : snippets/partial_regex_match.cpp
@ -49,7 +45,6 @@ exe partial_regex_match : snippets/partial_regex_match.cpp
<define>BOOST_REGEX_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe regex_grep_example_1 : snippets/regex_grep_example_1.cpp
@ -59,7 +54,6 @@ exe regex_grep_example_1 : snippets/regex_grep_example_1.cpp
<define>BOOST_REGEX_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe regex_grep_example_2 : snippets/regex_grep_example_2.cpp
@ -69,7 +63,6 @@ exe regex_grep_example_2 : snippets/regex_grep_example_2.cpp
<define>BOOST_REGEX_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe regex_grep_example_3 : snippets/regex_grep_example_3.cpp
@ -79,7 +72,6 @@ exe regex_grep_example_3 : snippets/regex_grep_example_3.cpp
<define>BOOST_REGEX_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe regex_grep_example_4 : snippets/regex_grep_example_4.cpp
@ -89,7 +81,6 @@ exe regex_grep_example_4 : snippets/regex_grep_example_4.cpp
<define>BOOST_REGEX_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe regex_match_example : snippets/regex_match_example.cpp
@ -99,7 +90,6 @@ exe regex_match_example : snippets/regex_match_example.cpp
<define>BOOST_REGEX_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe regex_merge_example : snippets/regex_merge_example.cpp
@ -109,7 +99,6 @@ exe regex_merge_example : snippets/regex_merge_example.cpp
<define>BOOST_REGEX_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe regex_search_example : snippets/regex_search_example.cpp
@ -119,7 +108,6 @@ exe regex_search_example : snippets/regex_search_example.cpp
<define>BOOST_REGEX_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe regex_split_example_1 : snippets/regex_split_example_1.cpp
@ -129,7 +117,6 @@ exe regex_split_example_1 : snippets/regex_split_example_1.cpp
<define>BOOST_REGEX_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe regex_split_example_2 : snippets/regex_split_example_2.cpp
@ -139,9 +126,9 @@ exe regex_split_example_2 : snippets/regex_split_example_2.cpp
<define>BOOST_REGEX_NO_LIB=1
:
debug
<runtime-link>dynamic
;

View File

@ -31,7 +31,29 @@
typedef std::map<std::string, int, std::less<std::string> > map_type;
boost::regex expression("^(template[[:space:]]*<[^;:{]+>[[:space:]]*)?(class|struct)[[:space:]]*(\\<\\w+\\>([[:blank:]]*\\([^)]*\\))?[[:space:]]*)*(\\<\\w*\\>)[[:space:]]*(<[^;:{]+>)?[[:space:]]*(\\{|:[^;\\{()]*\\{)");
const char* re =
// possibly leading whitespace:
"^[[:space:]]*"
// possible template declaration:
"(template[[:space:]]*<[^;:{]+>[[:space:]]*)?"
// class or struct:
"(class|struct)[[:space:]]*"
// leading declspec macros etc:
"("
"\\<\\w+\\>"
"("
"[[:blank:]]*\\([^)]*\\)"
")?"
"[[:space:]]*"
")*"
// the class name
"(\\<\\w*\\>)[[:space:]]*"
// template specialisation parameters
"(<[^;:{]+>)?[[:space:]]*"
// terminate in { or :
"(\\{|:[^;\\{()]*\\{)";
boost::regex expression(re);
class IndexClassesPred
{

View File

@ -32,7 +32,30 @@
typedef std::map<std::string, int, std::less<std::string> > map_type;
boost::regex expression("^(template[[:space:]]*<[^;:{]+>[[:space:]]*)?(class|struct)[[:space:]]*(\\<\\w+\\>([[:blank:]]*\\([^)]*\\))?[[:space:]]*)*(\\<\\w*\\>)[[:space:]]*(<[^;:{]+>)?[[:space:]]*(\\{|:[^;\\{()]*\\{)");
const char* re =
// possibly leading whitespace:
"^[[:space:]]*"
// possible template declaration:
"(template[[:space:]]*<[^;:{]+>[[:space:]]*)?"
// class or struct:
"(class|struct)[[:space:]]*"
// leading declspec macros etc:
"("
"\\<\\w+\\>"
"("
"[[:blank:]]*\\([^)]*\\)"
")?"
"[[:space:]]*"
")*"
// the class name
"(\\<\\w*\\>)[[:space:]]*"
// template specialisation parameters
"(<[^;:{]+>)?[[:space:]]*"
// terminate in { or :
"(\\{|:[^;\\{()]*\\{)";
boost::regex expression(re);
map_type class_index;
std::string::const_iterator base;

View File

@ -33,6 +33,29 @@
typedef std::map<std::string, int, std::less<std::string> > map_type;
const char* re =
// possibly leading whitespace:
"^[[:space:]]*"
// possible template declaration:
"(template[[:space:]]*<[^;:{]+>[[:space:]]*)?"
// class or struct:
"(class|struct)[[:space:]]*"
// leading declspec macros etc:
"("
"\\<\\w+\\>"
"("
"[[:blank:]]*\\([^)]*\\)"
")?"
"[[:space:]]*"
")*"
// the class name
"(\\<\\w*\\>)[[:space:]]*"
// template specialisation parameters
"(<[^;:{]+>)?[[:space:]]*"
// terminate in { or :
"(\\{|:[^;\\{()]*\\{)";
class class_index
{
boost::regex expression;
@ -45,7 +68,7 @@ public:
void IndexClasses(const std::string& file);
class_index()
: index(),
expression("^(template[[:space:]]*<[^;:{]+>[[:space:]]*)?(class|struct)[[:space:]]*(\\<\\w+\\>([[:blank:]]*\\([^)]*\\))?[[:space:]]*)*(\\<\\w*\\>)[[:space:]]*(<[^;:{]+>)?[[:space:]]*(\\{|:[^;\\{()]*\\{)")
expression(re)
{}
};

View File

@ -33,6 +33,29 @@
typedef std::map<std::string, int, std::less<std::string> > map_type;
const char* re =
// possibly leading whitespace:
"^[[:space:]]*"
// possible template declaration:
"(template[[:space:]]*<[^;:{]+>[[:space:]]*)?"
// class or struct:
"(class|struct)[[:space:]]*"
// leading declspec macros etc:
"("
"\\<\\w+\\>"
"("
"[[:blank:]]*\\([^)]*\\)"
")?"
"[[:space:]]*"
")*"
// the class name
"(\\<\\w*\\>)[[:space:]]*"
// template specialisation parameters
"(<[^;:{]+>)?[[:space:]]*"
// terminate in { or :
"(\\{|:[^;\\{()]*\\{)";
class class_index
{
boost::regex expression;
@ -47,7 +70,7 @@ public:
void IndexClasses(const std::string& file);
class_index()
: index(),
expression("^(template[[:space:]]*<[^;:{]+>[[:space:]]*)?(class|struct)[[:space:]]*(\\<\\w+\\>([[:blank:]]*\\([^)]*\\))?[[:space:]]*)*(\\<\\w*\\>)[[:space:]]*(<[^;:{]+>)?[[:space:]]*(\\{|:[^;\\{()]*\\{)")
expression(re)
{}
};

View File

@ -31,7 +31,30 @@
typedef std::map<std::string, int, std::less<std::string> > map_type;
boost::regex expression("^(template[[:space:]]*<[^;:{]+>[[:space:]]*)?(class|struct)[[:space:]]*(\\<\\w+\\>([[:blank:]]*\\([^)]*\\))?[[:space:]]*)*(\\<\\w*\\>)[[:space:]]*(<[^;:{]+>)?[[:space:]]*(\\{|:[^;\\{()]*\\{)");
const char* re =
// possibly leading whitespace:
"^[[:space:]]*"
// possible template declaration:
"(template[[:space:]]*<[^;:{]+>[[:space:]]*)?"
// class or struct:
"(class|struct)[[:space:]]*"
// leading declspec macros etc:
"("
"\\<\\w+\\>"
"("
"[[:blank:]]*\\([^)]*\\)"
")?"
"[[:space:]]*"
")*"
// the class name
"(\\<\\w*\\>)[[:space:]]*"
// template specialisation parameters
"(<[^;:{]+>)?[[:space:]]*"
// terminate in { or :
"(\\{|:[^;\\{()]*\\{)";
boost::regex expression(re);
void IndexClasses(map_type& m, const std::string& file)
{

View File

@ -890,7 +890,7 @@ protected:
// protected contructor for derived class...
match_results_base(bool){}
void BOOST_REGEX_CALL free();
void BOOST_REGEX_CALL m_free();
public:
@ -906,7 +906,7 @@ public:
~match_results_base()
{
free();
m_free();
}
size_type BOOST_REGEX_CALL size()const
@ -1096,7 +1096,7 @@ inline match_results_base<iterator, Allocator>& BOOST_REGEX_CALL match_results_b
{
if(ref != m.ref)
{
free();
m_free();
ref = m.ref;
++(ref->count);
}
@ -1105,7 +1105,7 @@ inline match_results_base<iterator, Allocator>& BOOST_REGEX_CALL match_results_b
template <class iterator, class Allocator>
void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::free()
void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::m_free()
{
if(--(ref->count) == 0)
{
@ -1162,7 +1162,7 @@ void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::set_size(size_typ
new (p1) sub_match<iterator>();
++p1;
}
free();
m_free();
}
catch(...)
{
@ -1204,7 +1204,7 @@ void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::set_size(size_typ
new (p1) sub_match<iterator>(j);
++p1;
}
free();
m_free();
}
catch(...)
{

View File

@ -270,7 +270,7 @@ using std::distance;
# define BOOST_REGEX_USE_C_LOCALE
#endif
#ifdef BOOST_REGEX_USE_WIN32_LOCALE
#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
# include <windows.h>
#endif

View File

@ -34,6 +34,27 @@ namespace boost{
#pragma option push -a4 -b -Ve -pc -w-8026
#endif
//
// Unfortunately Rogue Waves standard library appears to have a bug
// in std::basic_string::compare that results in eroneous answers
// in some cases (tested with Borland C++ 5.1, Rogue Wave lib version
// 0x020101) the test case was:
// {39135,0} < {0xff,0}
// which succeeds when it should not.
//
#ifndef _RWSTD_VER
# define STR_COMP(s,p) s.compare(p)
#else
template <class C, class T, class A>
int string_compare(const std::basic_string<C,T,A>& s, const C* p)
{ return s.compare(p); }
int string_compare(const std::string& s, const char* p)
{ return std::strcmp(s.c_str(), p); }
int string_compare(const std::wstring& s, const wchar_t* p)
{ return std::wcscmp(s.c_str(), p); }
# define STR_COMP(s,p) string_compare(s,p)
#endif
template <class iterator, class charT, class traits_type, class Allocator>
iterator BOOST_REGEX_CALL re_is_set_member(iterator next,
iterator last,
@ -104,11 +125,11 @@ iterator BOOST_REGEX_CALL re_is_set_member(iterator next,
traits_inst.transform(s1, s2);
for(i = 0; i < set_->cranges; ++i)
{
if(s1 <= p)
if(STR_COMP(s1, p) <= 0)
{
while(*p)++p;
++p;
if(s1 >= p)
if(STR_COMP(s1, p) >= 0)
return set_->isnot ? next : ++next;
}
else
@ -129,7 +150,7 @@ iterator BOOST_REGEX_CALL re_is_set_member(iterator next,
traits_inst.transform_primary(s1, s2);
for(i = 0; i < set_->cequivalents; ++i)
{
if(s1 == p)
if(STR_COMP(s1, p) == 0)
return set_->isnot ? next : ++next;
// skip string
while(*p)++p;
@ -163,9 +184,9 @@ public:
~_priv_match_data()
{
free();
m_free();
}
void free();
void m_free();
void set_accumulator_size(unsigned int size);
int* get_accumulators()
{
@ -191,7 +212,7 @@ void _priv_match_data<iterator, Allocator>::set_accumulator_size(unsigned int si
{
if(size > caccumulators)
{
free();
m_free();
caccumulators = size;
accumulators = i_alloc(temp_match.allocator()).allocate(caccumulators);
loop_starts = it_alloc(temp_match.allocator()).allocate(caccumulators);
@ -201,7 +222,7 @@ void _priv_match_data<iterator, Allocator>::set_accumulator_size(unsigned int si
}
template <class iterator, class Allocator>
void _priv_match_data<iterator, Allocator>::free()
void _priv_match_data<iterator, Allocator>::m_free()
{
if(caccumulators)
{
@ -1051,10 +1072,6 @@ namespace{
template <class Predicate, class I, class charT, class traits, class A, class A2>
unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<charT, traits, A>& e, unsigned flags, A2 a)
{
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4800)
#endif
typedef access_t<charT, traits, A> access;
if(e.flags() & regbase::failbit)

View File

@ -69,8 +69,9 @@ bool split_pred<OutputIterator, charT, Traits1, Alloc1, Alloc2>::operator()
{
*(*p_out) = static_cast<string_type>(what[i]);
++(*p_out);
return --*p_max;
if(0 == --*p_max) return false;
}
return *p_max != 0;
}
else
{

View File

@ -189,13 +189,13 @@ typedef lock_guard<critical_section> cs_guard;
BOOST_REGEX_DECL extern critical_section* p_re_lock;
BOOST_REGEX_DECL extern unsigned int re_lock_count;
#define BOOST_RE_GUARD(inst) boost::re_detail::critical_section::rw_guard g(inst);
#define BOOST_REGEX_GUARD(inst) boost::re_detail::critical_section::rw_guard g(inst);
#else // BOOST_RE_THREADS
#else // BOOST_HAS_THREADS
#define BOOST_RE_GUARD(inst)
#define BOOST_REGEX_GUARD(inst)
#endif // BOOST_RE_THREADS
#endif // BOOST_HAS_THREADS
#ifdef __BORLANDC__
#pragma option pop

View File

@ -239,7 +239,7 @@ public:
}
~c_regex_traits()
{
free();
m_free();
}
struct sentry
{
@ -250,7 +250,7 @@ public:
static void BOOST_REGEX_CALL update();
private:
static void BOOST_REGEX_CALL init();
static void BOOST_REGEX_CALL free();
static void BOOST_REGEX_CALL m_free();
static c_regex_traits<char> i;
static unsigned sort_type;
@ -307,7 +307,7 @@ public:
c_regex_traits<wchar_t>()
{ init(); }
~c_regex_traits<wchar_t>()
{ free(); }
{ m_free(); }
struct sentry
{
sentry(const c_regex_traits<wchar_t>&)
@ -319,7 +319,7 @@ public:
static unsigned int BOOST_REGEX_CALL strwiden(wchar_t *s1, unsigned int len, const char *s2);
private:
static bool BOOST_REGEX_CALL do_iswclass(wchar_t c, boost::uint_fast32_t f);
static void BOOST_REGEX_CALL free();
static void BOOST_REGEX_CALL m_free();
static void BOOST_REGEX_CALL init();
static bool BOOST_REGEX_CALL do_lookup_collate(std::basic_string<wchar_t>& out, const wchar_t* first, const wchar_t* last);
static c_regex_traits<wchar_t> init_;
@ -733,7 +733,7 @@ public:
return true;
if((f & char_class_blank) && ((c == ' ') || (c == '\t')))
return true;
if((f & char_class_unicode) && (c > (size_type)(uchar_type)255))
if((f & char_class_unicode) && ((uchar_type)c > (uchar_type)255))
return true;
return false;
}

View File

@ -158,12 +158,14 @@ result of a match contains a number of sub-expression matches in
addition to the overall match. When the library needs to report a
regular expression match it does so using an instance of the
class <a href="template_class_ref.htm#reg_match">match_results</a>,
as before there are typedefs of this class for the two most
common cases: </p>
as before there are typedefs of this class for the most common
cases: </p>
<pre><b>namespace </b>boost{
<b>typedef</b> match_results&lt;<b>const</b> <b>char</b>*&gt; cmatch;
<b>typedef</b> match_results&lt;<b>const</b> <b>wchar_t</b>*&gt; wcmatch;
<strong>typedef</strong> match_results&lt;std::string::const_iterator&gt; smatch;
<strong>typedef</strong> match_results&lt;std::wstring::const_iterator&gt; wsmatch;
}</pre>
<p>The algorithms <a href="template_class_ref.htm#reg_search">regex_search</a>

View File

@ -381,7 +381,7 @@ void BOOST_REGEX_CALL re_message_free()
const char* BOOST_REGEX_CALL re_get_error_str(unsigned int id)
{
BOOST_RE_GUARD_STACK
#ifdef BOOST_RE_THREADS
#ifdef BOOST_HAS_THREADS
boost::re_detail::cs_guard g(*boost::re_detail::p_re_lock);
#endif
if(re_custom_error_messages[id] == 0)
@ -576,7 +576,7 @@ c_regex_traits<char> c_regex_traits<char>::i;
void BOOST_REGEX_CALL c_regex_traits<char>::init()
{
BOOST_RE_GUARD_STACK
#ifdef BOOST_RE_THREADS
#ifdef BOOST_HAS_THREADS
re_detail::re_init_threads();
re_detail::cs_guard g(*re_detail::p_re_lock);
#endif
@ -602,7 +602,7 @@ void BOOST_REGEX_CALL c_regex_traits<char>::init()
void BOOST_REGEX_CALL c_regex_traits<char>::update()
{
BOOST_RE_GUARD_STACK
#ifdef BOOST_RE_THREADS
#ifdef BOOST_HAS_THREADS
re_detail::cs_guard g(*re_detail::p_re_lock);
#endif
re_message_update();
@ -619,10 +619,10 @@ void BOOST_REGEX_CALL c_regex_traits<char>::update()
sort_type = re_detail::find_sort_syntax(&i, &sort_delim);
}
void BOOST_REGEX_CALL c_regex_traits<char>::free()
void BOOST_REGEX_CALL c_regex_traits<char>::m_free()
{
BOOST_RE_GUARD_STACK
#ifdef BOOST_RE_THREADS
#ifdef BOOST_HAS_THREADS
re_detail::cs_guard g(*re_detail::p_re_lock);
#endif
re_message_free();
@ -634,7 +634,7 @@ void BOOST_REGEX_CALL c_regex_traits<char>::free()
delete ctype_name;
delete collate_name;
}
#ifdef BOOST_RE_THREADS
#ifdef BOOST_HAS_THREADS
g.acquire(false);
re_detail::re_free_threads();
#endif
@ -746,7 +746,7 @@ void BOOST_REGEX_CALL c_regex_traits<wchar_t>::init()
{
BOOST_RE_GUARD_STACK
re_detail::re_init_threads();
#ifdef BOOST_RE_THREADS
#ifdef BOOST_HAS_THREADS
re_detail::cs_guard g(*re_detail::p_re_lock);
#endif
re_message_init();
@ -790,7 +790,7 @@ bool BOOST_REGEX_CALL c_regex_traits<wchar_t>::do_lookup_collate(std::basic_stri
void BOOST_REGEX_CALL c_regex_traits<wchar_t>::update()
{
BOOST_RE_GUARD_STACK
#ifdef BOOST_RE_THREADS
#ifdef BOOST_HAS_THREADS
re_detail::cs_guard g(*re_detail::p_re_lock);
#endif
re_message_update();
@ -838,10 +838,10 @@ void BOOST_REGEX_CALL c_regex_traits<wchar_t>::update()
}
}
void BOOST_REGEX_CALL c_regex_traits<wchar_t>::free()
void BOOST_REGEX_CALL c_regex_traits<wchar_t>::m_free()
{
BOOST_RE_GUARD_STACK
#ifdef BOOST_RE_THREADS
#ifdef BOOST_HAS_THREADS
re_detail::cs_guard g(*re_detail::p_re_lock);
#endif
--nlsw_count;
@ -854,7 +854,7 @@ void BOOST_REGEX_CALL c_regex_traits<wchar_t>::free()
delete wlocale_name;
delete syntax;
}
#ifdef BOOST_RE_THREADS
#ifdef BOOST_HAS_THREADS
g.acquire(false);
re_detail::re_free_threads();
#endif

View File

@ -25,7 +25,7 @@
#include <boost/cregex.hpp>
#include <boost/regex.hpp>
#if !defined(BOOST_RE_NO_STRING_H)
#if !defined(BOOST_NO_STD_STRING)
#include <map>
#include <list>
#include <boost/regex/detail/fileiter.hpp>

View File

@ -45,7 +45,7 @@ regbase::regbase(const regbase& b)
} // namespace boost
#if defined(BOOST_RE_USE_VCL) && defined(BOOST_RE_BUILD_DLL)
#if defined(BOOST_RE_USE_VCL) && defined(BOOST_REGEX_BUILD_DLL)
int WINAPI DllEntryPoint(HINSTANCE , unsigned long , void*)
{

View File

@ -199,7 +199,7 @@ unsigned int BOOST_REGEX_CALL _re_get_message(char* buf, unsigned int len, unsig
const char* BOOST_REGEX_CALL re_get_error_str(unsigned int id)
{
BOOST_RE_GUARD_STACK
#ifdef BOOST_RE_THREADS
#ifdef BOOST_HAS_THREADS
boost::re_detail::cs_guard g(*boost::re_detail::p_re_lock);
#endif
if(re_custom_error_messages[id] == 0)
@ -441,7 +441,7 @@ bool BOOST_REGEX_CALL w32_traits_base::do_lookup_collate(std::string& buf, const
std::string BOOST_REGEX_CALL w32_traits_base::set_message_catalogue(const std::string& l)
{
BOOST_RE_GUARD_STACK
#ifdef BOOST_RE_THREADS
#ifdef BOOST_HAS_THREADS
re_detail::cs_guard g(*re_detail::p_re_lock);
#endif
if(sizeof(regex_message_catalogue) <= l.size())
@ -462,7 +462,7 @@ w32_regex_traits<char> w32_regex_traits<char>::i;
void BOOST_REGEX_CALL w32_regex_traits<char>::update()
{
BOOST_RE_GUARD_STACK
#ifdef BOOST_RE_THREADS
#ifdef BOOST_HAS_THREADS
re_detail::cs_guard g(*re_detail::p_re_lock);
#endif
do_init();
@ -471,7 +471,7 @@ void BOOST_REGEX_CALL w32_regex_traits<char>::update()
w32_regex_traits<char>::w32_regex_traits()
{
BOOST_RE_GUARD_STACK
#ifdef BOOST_RE_THREADS
#ifdef BOOST_HAS_THREADS
re_detail::re_init_threads();
re_detail::cs_guard g(*re_detail::p_re_lock);
#endif
@ -481,12 +481,12 @@ w32_regex_traits<char>::w32_regex_traits()
w32_regex_traits<char>::~w32_regex_traits()
{
BOOST_RE_GUARD_STACK
#ifdef BOOST_RE_THREADS
#ifdef BOOST_HAS_THREADS
re_detail::cs_guard g(*re_detail::p_re_lock);
#endif
if(--entry_count == 0)
do_free();
#ifdef BOOST_RE_THREADS
#ifdef BOOST_HAS_THREADS
g.acquire(false);
re_detail::re_free_threads();
#endif
@ -629,7 +629,7 @@ bool BOOST_REGEX_CALL w32_regex_traits<wchar_t>::do_lookup_collate(std::basic_st
void BOOST_REGEX_CALL w32_regex_traits<wchar_t>::update()
{
BOOST_RE_GUARD_STACK
#ifdef BOOST_RE_THREADS
#ifdef BOOST_HAS_THREADS
re_detail::cs_guard g(*re_detail::p_re_lock);
#endif
do_init();
@ -638,7 +638,7 @@ void BOOST_REGEX_CALL w32_regex_traits<wchar_t>::update()
w32_regex_traits<wchar_t>::w32_regex_traits()
{
BOOST_RE_GUARD_STACK
#ifdef BOOST_RE_THREADS
#ifdef BOOST_HAS_THREADS
re_detail::re_init_threads();
re_detail::cs_guard g(*re_detail::p_re_lock);
#endif
@ -648,12 +648,12 @@ w32_regex_traits<wchar_t>::w32_regex_traits()
w32_regex_traits<wchar_t>::~w32_regex_traits()
{
BOOST_RE_GUARD_STACK
#ifdef BOOST_RE_THREADS
#ifdef BOOST_HAS_THREADS
re_detail::cs_guard g(*re_detail::p_re_lock);
#endif
if(--entry_count == 0)
do_free();
#ifdef BOOST_RE_THREADS
#ifdef BOOST_HAS_THREADS
g.acquire(false);
re_detail::re_free_threads();
#endif

View File

@ -28,7 +28,7 @@
#include <boost/regex.hpp>
#ifndef BOOST_RE_NO_WCHAR_H
#ifndef BOOST_NO_WREGEX
#include <cwchar>
#endif
#include <cstring>

View File

@ -51,10 +51,10 @@ expression compilation. </p>
<p>All characters are literals except: &quot;.&quot;,
&quot;*&quot;, &quot;?&quot;, &quot;+&quot;, &quot;(&quot;,
&quot;)&quot;, &quot;{&quot;, &quot;}&quot;, &quot;[&quot;,
&quot;]&quot;, &quot;^&quot; and &quot;$&quot;. These characters
are literals when preceded by a &quot;\&quot;. A literal is a
character that matches itself, or matches the result of
traits_type::translate(), where traits_type is the traits
&quot;]&quot;, &quot;^&quot;, &quot;$&quot; and &quot;\&quot;.
These characters are literals when preceded by a &quot;\&quot;. A
literal is a character that matches itself, or matches the result
of traits_type::translate(), where traits_type is the traits
template parameter to class reg_expression. <br>
&nbsp; <br>
&nbsp; </p>

View File

@ -871,7 +871,9 @@ each sub-expression match being contained in an object of type <i>sub_match</i>.
&nbsp;&nbsp; <b>bool</b> <b>operator</b>&lt;(<b>const</b> match_results&amp; that)<b>const</b>;
};
<strong>typedef</strong> match_results&lt;<strong>const</strong> <strong>char</strong>*&gt; cmatch;
<strong>typedef</strong> match_results&lt;<strong>const</strong> <strong>wchar_t</strong>*&gt; wcmatch; </pre>
<strong>typedef</strong> match_results&lt;<strong>const</strong> <strong>wchar_t</strong>*&gt; wcmatch;
<strong>typedef</strong> match_results&lt;std::string::const_iterator&gt; smatch;
<strong>typedef</strong> match_results&lt;std::wstring::const_iterator&gt; wsmatch; </pre>
<p>Class match_results is used for reporting what matched a
regular expression, it is passed to the matching algorithms <a
@ -1128,10 +1130,10 @@ properties. </p>
<p>The algorithm regex _match determines whether a given regular
expression matches a given sequence denoted by a pair of
bidirectional-iterators, the algorithm is defined as follows,
note that the result is true only if the expression matches the
whole of the input sequence, the main use of this function is
data input validation: </p>
bidirectional-iterators, the algorithm is defined as follows, <em>note
that the result is true only if the expression matches the whole
of the input sequence</em>, the main use of this function is data
input validation: </p>
<pre><b>template</b> &lt;<b>class</b> iterator, <b>class</b> Allocator, <b>class</b> charT, <b>class</b> traits, <b>class</b> Allocator2&gt;
<b>bool</b> regex_match(iterator first,&nbsp;
@ -1205,7 +1207,12 @@ return true or false and do not indicate what matched: </p>
will be less than or equal to last. m[1] denotes the
first subexpression m[2] the second subexpression and so
on. If no match occurred then m[0].first = m[0].second =
last.</td>
last.<p>Note that since the match_results structure
stores only iterators, and not strings, the iterators/strings
passed to regex_match must be valid for as long as the
result is to be used. For that reason never pass
temporary string objects to regex_match.</p>
</td>
<td>&nbsp;</td>
</tr>
<tr>
@ -1456,7 +1463,13 @@ upon your compilers capabilities]: </p>
that matched, m[0].first and m[0].second will be less
than or equal to last. m[1] denotes the first sub-expression
m[2] the second sub-expression and so on. If no match
occurred then m[0].first = m[0].second = last.</td>
occurred then m[0].first = m[0].second = last.<p>Note
that since the match_results structure stores only
iterators, and not strings, the iterators/strings passed
to regex_search must be valid for as long as the result
is to be used. For that reason never pass temporary
string objects to regex_search.</p>
</td>
<td>&nbsp;</td>
</tr>
<tr>
@ -1985,7 +1998,7 @@ not match are copied to the output unchanged only if the flags
parameter does not have the flag <a href="#format_flags">format_no_copy</a>
set. If the flag <a href="#format_flags">format_first_only</a> is
set then only the first occurance is replaced rather than all
occurances.</p>
occurrences.</p>
<pre><b>template</b> &lt;<b>class</b> OutputIterator, <b>class</b> iterator, <b>class</b> traits, <b>class</b> Allocator, <b>class</b> charT&gt;
OutputIterator regex_merge(OutputIterator out,&nbsp;

View File

@ -8,7 +8,6 @@ unit-test regress : regress/parse.cpp regress/regress.cpp regress/tests.cpp
<define>BOOST_REGEX_NO_LIB=1
:
debug
<runtime-link>dynamic
;
unit-test wregress : regress/parse.cpp regress/regress.cpp regress/tests.cpp
@ -19,7 +18,6 @@ unit-test wregress : regress/parse.cpp regress/regress.cpp regress/tests.cpp
<define>TEST_UNICODE=1
:
debug
<runtime-link>dynamic
;
unit-test posix_api_check_c : c_compiler_checks/posix_api_check.c
@ -29,7 +27,6 @@ unit-test posix_api_check_c : c_compiler_checks/posix_api_check.c
<define>BOOST_REGEX_NO_LIB=1
:
debug
<runtime-link>dynamic
;
unit-test wide_posix_api_check_c : c_compiler_checks/wide_posix_api_check.c
@ -39,7 +36,6 @@ unit-test wide_posix_api_check_c : c_compiler_checks/wide_posix_api_check.c
<define>BOOST_REGEX_NO_LIB=1
:
debug
<runtime-link>dynamic
;
unit-test posix_api_check : c_compiler_checks/posix_api_check.cpp
@ -49,7 +45,6 @@ unit-test posix_api_check : c_compiler_checks/posix_api_check.cpp
<define>BOOST_REGEX_NO_LIB=1
:
debug
<runtime-link>dynamic
;
unit-test wide_posix_api_check : c_compiler_checks/wide_posix_api_check.cpp
@ -59,8 +54,8 @@ unit-test wide_posix_api_check : c_compiler_checks/wide_posix_api_check.cpp
<define>BOOST_REGEX_NO_LIB=1
:
debug
<runtime-link>dynamic
;

View File

@ -37,11 +37,16 @@ using namespace boost;
flag_info flag_data[] = {
{ BOOST_RE_STR("REG_BASIC"), 9, REG_BASIC, 0 },
{ BOOST_RE_STR("REG_EXTENDED"), 12, REG_EXTENDED, 0 },
{ BOOST_RE_STR("REG_ESCAPE_IN_LISTS"), 19, REG_ESCAPE_IN_LISTS, 0 },
{ BOOST_RE_STR("REG_ICASE"), 9, REG_ICASE, 0 },
{ BOOST_RE_STR("REG_NOSUB"), 9, REG_NOSUB, 0 },
{ BOOST_RE_STR("REG_NEWLINE"), 11, REG_NEWLINE, 0 },
{ BOOST_RE_STR("REG_NEWLINE"), 11, REG_NEWLINE, 0 },
{ BOOST_RE_STR("REG_NOCOLLATE"), 13, REG_NOCOLLATE, 0 },
{ BOOST_RE_STR("REG_NOSPEC"), 10, REG_NOSPEC, 0 },
{ BOOST_RE_STR("REG_NEWLINE_ALT"), 15, REG_NEWLINE_ALT , 0 },
{ BOOST_RE_STR("REG_PERL"), 8, REG_PERL, 0 },
{ BOOST_RE_STR("REG_AWK"), 7, REG_AWK, 0 },
{ BOOST_RE_STR("REG_EGREP"), 9, REG_EGREP, 0 },
{ BOOST_RE_STR("REG_NOTBOL"), 10, REG_NOTBOL, 1 },
{ BOOST_RE_STR("REG_NOTEOL"), 10, REG_NOTEOL, 1 },

View File

@ -46,6 +46,9 @@ using std::endl;
#if defined(BOOST_MSVC) && defined(_DEBUG)
#include <CRTDBG.H>
#endif
#ifdef TIME_TEST
#include <boost/timer.hpp>
#endif
//
@ -82,6 +85,9 @@ int cpp_main(int argc, char * argv[])
tmpFlag |= _CRTDBG_LEAK_CHECK_DF;
tmpFlag &= ~_CRTDBG_CHECK_CRT_DF;
_CrtSetDbgFlag( tmpFlag );
#endif
#ifdef TIME_TEST
boost::timer tim;
#endif
if(argc < 2)
usage();
@ -113,6 +119,10 @@ int cpp_main(int argc, char * argv[])
}
cout << line << " lines, " << tests << " tests completed in file " << argv[i] << endl;
}
#ifdef TIME_TEST
double elapsed_time = tim.elapsed();
cout << "Elapsed time = " << elapsed_time << "s" << endl;
#endif
return error_count;
}

View File

@ -503,8 +503,10 @@ a(b+|((c)*))+d abcd 0 4 2 3 2 3 2 3
'([^\\']|\\.)*' '\\n' 0 4 1 3
; now try and test some unicode specific characters:
- match_default normal REG_EXTENDED REG_UNICODE_ONLY
- match_default normal REG_PERL REG_UNICODE_ONLY
[[:unicode:]]+ a\0300\0400z 1 3
[\x10-\xff] \39135\12409 -1 -1
[\01-\05]{5} \36865\36865\36865\36865\36865 -1 -1
; finally try some case insensitive matches:
- match_default normal REG_EXTENDED REG_ICASE
@ -880,3 +882,4 @@ a+(?#b+)b+ xaaabbba 1 7