Compare commits

..

18 Commits

Author SHA1 Message Date
6d65cfb7bb This commit was manufactured by cvs2svn to create tag
'Version_1_24_0'.

[SVN r10904]
2001-08-20 14:01:13 +00:00
139a2f60fb Updated build system (more or less works now)
[SVN r10890]
2001-08-18 11:50:48 +00:00
a4912a834e Fixed initialisation order warnings (gcc)
[SVN r10887]
2001-08-18 10:22:53 +00:00
014b66b2f4 Removed non-functioning msvc link command from Jamfile, added user32.lib forced link to w32_regex_traits.cpp
[SVN r10886]
2001-08-18 10:22:10 +00:00
b2ea26705d Added (as yet non-functional msvc library support)
[SVN r10876]
2001-08-16 11:43:22 +00:00
432f59cde7 Updated Jamfile (it works now!)
[SVN r10850]
2001-08-13 11:34:37 +00:00
846da064e0 Added Jamfile
[SVN r10843]
2001-08-12 11:55:51 +00:00
88a6779e8b Fixed WinXP problems
[SVN r10842]
2001-08-11 11:50:34 +00:00
5749937f26 Fixed some WinXP problems
[SVN r10841]
2001-08-11 11:49:19 +00:00
e1492c79ce updated jamfile, fixed Windows XP problems
[SVN r10840]
2001-08-11 11:47:12 +00:00
a06c964cab Spell things consistently. Add some bits of Mac stuff to the tests.
Use std::size_t where needed.


[SVN r10800]
2001-08-07 17:22:02 +00:00
77f76889f8 Minor purify error fixes
[SVN r10713]
2001-07-28 11:23:09 +00:00
50c4d1e6ca Fixed some purify errors (unitialised reads)
[SVN r10712]
2001-07-28 11:22:28 +00:00
7079ba0424 tweeked docs - added credits + iterator categories.
[SVN r10701]
2001-07-25 10:20:47 +00:00
e7b8b5712d Fixed nasty bug, where some invalid expressions caused access violations.
[SVN r10688]
2001-07-22 10:26:54 +00:00
f5f309be54 Initial checkin. Needs tweaks for various compilers.
[SVN r10683]
2001-07-21 13:06:09 +00:00
890dc95e0d fixed relative link
[SVN r10610]
2001-07-14 10:54:55 +00:00
517d3e9256 Change absolute URL's to relative
[SVN r10594]
2001-07-12 15:31:15 +00:00
13 changed files with 2247 additions and 1966 deletions

File diff suppressed because it is too large Load Diff

26
build/Jamfile Normal file
View File

@ -0,0 +1,26 @@
subproject libs/regex/build ;
SOURCES = c_regex_traits c_regex_traits_common cpp_regex_traits
cregex fileiter posix_api regex regex_debug
regex_synch w32_regex_traits wide_posix_api ;
lib libboost_regex$(SUFLIB) : ../src/$(SOURCES).cpp
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug release
<runtime-link>dynamic
;
dll libboost_regex$(SUFDLL[1]) : ../src/$(SOURCES).cpp
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_BUILD_DLL=1
:
debug release
<runtime-link>dynamic
;

View File

@ -196,7 +196,7 @@ ADDED: High level C++ class RegEx.
Version 111:
BUG: Wouldn't compile directly on C++ Builder 4 when it was released
(not really a bug - more an incompatability)
(not really a bug - more an incompatibility)
FIXED: All bugs discovered prior to this version (below).

147
example/Jamfile Normal file
View File

@ -0,0 +1,147 @@
subproject libs/regex/example ;
exe timer : timer/regex_timer.cpp
<lib>../build/libboost_regex$(SUFLIB)
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe jgrep : jgrep/jgrep.cpp jgrep/main.cpp
<lib>../build/libboost_regex$(SUFLIB)
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe credit_card_example : snippets/credit_card_example.cpp
<lib>../build/libboost_regex$(SUFLIB)
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe partial_regex_grep : snippets/partial_regex_grep.cpp
<lib>../build/libboost_regex$(SUFLIB)
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe partial_regex_match : snippets/partial_regex_match.cpp
<lib>../build/libboost_regex$(SUFLIB)
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe regex_grep_example_1 : snippets/regex_grep_example_1.cpp
<lib>../build/libboost_regex$(SUFLIB)
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe regex_grep_example_2 : snippets/regex_grep_example_2.cpp
<lib>../build/libboost_regex$(SUFLIB)
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe regex_grep_example_3 : snippets/regex_grep_example_3.cpp
<lib>../build/libboost_regex$(SUFLIB)
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe regex_grep_example_4 : snippets/regex_grep_example_4.cpp
<lib>../build/libboost_regex$(SUFLIB)
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe regex_match_example : snippets/regex_match_example.cpp
<lib>../build/libboost_regex$(SUFLIB)
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe regex_merge_example : snippets/regex_merge_example.cpp
<lib>../build/libboost_regex$(SUFLIB)
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe regex_search_example : snippets/regex_search_example.cpp
<lib>../build/libboost_regex$(SUFLIB)
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe regex_split_example_1 : snippets/regex_split_example_1.cpp
<lib>../build/libboost_regex$(SUFLIB)
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe regex_split_example_2 : snippets/regex_split_example_2.cpp
<lib>../build/libboost_regex$(SUFLIB)
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug
<runtime-link>dynamic
;

View File

@ -4,7 +4,8 @@
#
jgrep.exe: main.cpp jgrep.cpp jgrep.h
cl -GX -GR /Oityb1 /GF /Gy -I..\..\..\..\ jgrep.cpp main.cpp /link /LIBPATH:..\..\build\vc6 user32.lib
cl -GX -GR /Oityb1 /GF /Gy -I..\..\..\..\ jgrep.cpp main.cpp /link /LIBPATH:..\..\build\vc6

View File

@ -100,7 +100,7 @@ int main()
std::deque<char> ds;
boost::regex_t r;
boost::scoped_array<boost::regmatch_t> matches;
size_t nsubs;
std::size_t nsubs;
boost::timer t;
double tim;
bool result;
@ -117,9 +117,9 @@ int main()
std::copy(s1.begin(), s1.end(), string_out_iterator<std::wstring>(ws1));
#endif
try{
ex.assign(s1.begin(), s1.end());
ex.assign(s1);
#ifndef BOOST_RE_NO_WCSTRING
wex.assign(ws1.begin(), ws1.end());
wex.assign(ws1);
#endif
}
catch(std::exception& e)

View File

@ -3,7 +3,7 @@
#
CXX=cl
CXXFLAGS=/Oityb1 /GF /Gy -GX -DSTRICT -I../../../../ -I./
LIBS=/link /LIBPATH:..\..\build\vc6 kernel32.lib user32.lib
LIBS=/link /LIBPATH:..\..\build\vc6
EXE=.exe
OBJ=.obj
@ -31,3 +31,4 @@ timer$(OBJ) : ../../../timer/timer.cpp $(LIBDEP)

View File

@ -23,7 +23,7 @@
*/
/* start with C compatability API */
/* start with C compatibility API */
#ifndef BOOST_RE_REGEX_HPP
#define BOOST_RE_REGEX_HPP
@ -527,11 +527,11 @@ public:
template <class ST, class SA>
explicit reg_expression(const std::basic_string<charT, ST, SA>& p, flag_type f = regbase::normal, const Allocator& a = Allocator())
: data(a), pkmp(0) { set_expression(p, f | regbase::use_except); }
: data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0) { set_expression(p, f | regbase::use_except); }
template <class I>
reg_expression(I first, I last, flag_type f = regbase::normal, const Allocator& al = Allocator())
: data(al), pkmp(0)
: data(al), pkmp(0), error_code_(REG_EMPTY), _expression(0)
{
size_type len = last-first;
scoped_array<charT> a(new charT[len]);
@ -637,7 +637,7 @@ public:
bool BOOST_RE_CALL operator<(const reg_expression&)const;
//
// The following are deprecated as public interfaces
// but are available for compatability with earlier versions.
// but are available for compatibility with earlier versions.
allocator_type BOOST_RE_CALL allocator()const;
const charT* BOOST_RE_CALL expression()const { return (this->error_code() ? 0 : _expression); }
unsigned int BOOST_RE_CALL set_expression(const charT* p, const charT* end, flag_type f = regbase::normal);
@ -656,14 +656,14 @@ private:
unsigned marks;
int repeats;
unsigned char* startmap;
charT* _expression;
unsigned _expression_len;
unsigned int _leading_len;
const charT* _leading_string;
unsigned int _leading_string_len;
re_detail::kmp_info<charT>* pkmp;
traits_type traits_inst;
unsigned error_code_;
charT* _expression;
traits_type traits_inst;
void BOOST_RE_CALL compile_maps();
void BOOST_RE_CALL compile_map(re_detail::re_syntax_base* node, unsigned char* _map, unsigned int* pnull, unsigned char mask, re_detail::re_syntax_base* terminal = 0)const;

View File

@ -91,34 +91,34 @@ inline bool BOOST_RE_CALL reg_expression<charT, traits, Allocator>::can_start(ch
template <class charT, class traits, class Allocator>
CONSTRUCTOR_INLINE reg_expression<charT, traits, Allocator>::reg_expression(const Allocator& a)
: regbase(), data(a), pkmp(0), error_code_(REG_EMPTY)
: regbase(), data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0)
{
}
template <class charT, class traits, class Allocator>
CONSTRUCTOR_INLINE reg_expression<charT, traits, Allocator>::reg_expression(const charT* p, flag_type f, const Allocator& a)
: data(a), pkmp(0), error_code_(REG_EMPTY)
: data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0)
{
set_expression(p, f | regbase::use_except);
}
template <class charT, class traits, class Allocator>
CONSTRUCTOR_INLINE reg_expression<charT, traits, Allocator>::reg_expression(const charT* p1, const charT* p2, flag_type f, const Allocator& a)
: data(a), pkmp(0), error_code_(REG_EMPTY)
: data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0)
{
set_expression(p1, p2, f | regbase::use_except);
}
template <class charT, class traits, class Allocator>
CONSTRUCTOR_INLINE reg_expression<charT, traits, Allocator>::reg_expression(const charT* p, size_type len, flag_type f, const Allocator& a)
: data(a), pkmp(0), error_code_(REG_EMPTY)
: data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0)
{
set_expression(p, p + len, f | regbase::use_except);
}
template <class charT, class traits, class Allocator>
reg_expression<charT, traits, Allocator>::reg_expression(const reg_expression<charT, traits, Allocator>& e)
: regbase(e), data(e.allocator()), pkmp(0), error_code_(REG_EMPTY)
: regbase(e), data(e.allocator()), pkmp(0), error_code_(REG_EMPTY), _expression(0)
{
//
// we do a deep copy only if e is a valid expression, otherwise fail.
@ -1379,12 +1379,12 @@ unsigned int BOOST_RE_CALL reg_expression<charT, traits, Allocator>::set_express
{
((re_detail::re_jump*)dat)->alt.i = data.size();
mark.pop();
dat = (re_detail::re_jump*)((unsigned char*)data.data() + mark.peek());
if(mark.empty())
{
fail(REG_EPAREN);
return error_code();
}
dat = (re_detail::re_jump*)((unsigned char*)data.data() + mark.peek());
}
dat = add_simple(0, re_detail::syntax_element_endmark, sizeof(re_detail::re_brace));

View File

@ -348,9 +348,10 @@ struct BOOST_RE_IX_DECL w32_traits_base : public regex_traits_base
char_class_upper = C1_UPPER,
char_class_xdigit = C1_XDIGIT,
char_class_blank = C1_BLANK,
char_class_underscore = 0x0200,
char_class_underscore = 0x0400,
char_class_word = C1_ALPHA | C1_DIGIT | char_class_underscore,
char_class_unicode = 0x0400
char_class_unicode = 0x0800,
char_class_win = C1_ALPHA | C1_CNTRL | C1_UPPER | C1_LOWER | C1_DIGIT | C1_PUNCT | C1_BLANK | C1_SPACE | C1_XDIGIT | C1_BLANK
};
public:
static std::string BOOST_RE_CALL set_message_catalogue(const std::string& s);

View File

@ -32,6 +32,13 @@
#if defined(_WIN32) && !defined(BOOST_RE_NO_W32)
//
// VC6 needs to link to user32.lib:
//
#ifdef BOOST_MSVC
#pragma comment(lib, "user32.lib")
#endif
namespace{
//
@ -272,6 +279,10 @@ void BOOST_RE_CALL w32_traits_base::do_init()
}
buf[map_size] = (char)0;
GetStringTypeA(GetUserDefaultLCID(), CT_CTYPE1, buf, map_size, class_map);
for(i = 0; i < map_size; ++i)
{
class_map[i] &= char_class_win;
}
class_map['_'] |= char_class_underscore;
LCMapStringA(GetUserDefaultLCID(), LCMAP_LOWERCASE, buf, map_size, lower_case_map, map_size);
//
@ -654,7 +665,7 @@ bool BOOST_RE_CALL w32_regex_traits<wchar_t>::do_iswclass(wchar_t c, boost::uint
if(f & char_class_unicode)
return true;
else if(isPlatformNT && GetStringTypeW(CT_CTYPE1, &c, 1, &mask))
return BOOST_RE_MAKE_BOOL(mask & f);
return BOOST_RE_MAKE_BOOL(mask & f &char_class_win);
else if((f & char_class_graph) == char_class_graph)
return true; // all wide characters are considered "graphics"
return false;

File diff suppressed because it is too large Load Diff

65
test/Jamfile Normal file
View File

@ -0,0 +1,65 @@
subproject libs/regex/test ;
exe regress : regress/parse.cpp regress/regress.cpp regress/tests.cpp
<lib>../build/libboost_regex$(SUFLIB)
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe wregress : regress/parse.cpp regress/regress.cpp regress/tests.cpp
<lib>../build/libboost_regex$(SUFLIB)
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
<define>TEST_UNICODE=1
:
debug
<runtime-link>dynamic
;
exe posix_api_check_c : c_compiler_checks/posix_api_check.c
<lib>../build/libboost_regex$(SUFLIB)
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe wide_posix_api_check_c : c_compiler_checks/wide_posix_api_check.c
<lib>../build/libboost_regex$(SUFLIB)
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe posix_api_check : c_compiler_checks/posix_api_check.cpp
<lib>../build/libboost_regex$(SUFLIB)
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug
<runtime-link>dynamic
;
exe wide_posix_api_check : c_compiler_checks/wide_posix_api_check.cpp
<lib>../build/libboost_regex$(SUFLIB)
:
<include>$(BOOST_ROOT)
<define>BOOST_RE_NO_LIB=1
:
debug
<runtime-link>dynamic
;