forked from boostorg/regex
Compare commits
34 Commits
svn-branch
...
boost-1.30
Author | SHA1 | Date | |
---|---|---|---|
136f8c02e0 | |||
34762f91fb | |||
644e41ba31 | |||
51fe53f437 | |||
6d4dd63cba | |||
686a939498 | |||
86e5251979 | |||
cebaf09b5d | |||
d0ba00a2e7 | |||
75293e9854 | |||
45e593c4fe | |||
251099c828 | |||
5705d52e84 | |||
88a0f9d75a | |||
fbb087dec9 | |||
c84ebf1c5b | |||
1eec12f177 | |||
82ad27c468 | |||
897c33be2a | |||
2ecd905fb2 | |||
abef9c7249 | |||
0e37a76df0 | |||
adc4ee41e3 | |||
9a4e5d29c1 | |||
ff4890b2e2 | |||
3a5f4775f7 | |||
5a65397974 | |||
e5d9c95456 | |||
b6a13dd215 | |||
cf285ed3e5 | |||
66ddab7fae | |||
09bfc7f853 | |||
13df8a293b | |||
40ab965ee9 |
@ -9,6 +9,8 @@ lib boost_regex : ../src/$(SOURCES).cpp
|
||||
<sysinclude>$(BOOST_ROOT)
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
std::facet-support
|
||||
|
||||
:
|
||||
debug release
|
||||
;
|
||||
|
15
build/Jamfile.v2
Normal file
15
build/Jamfile.v2
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
project boost/regex
|
||||
: source-location ../src
|
||||
;
|
||||
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 instances winstances ;
|
||||
|
||||
|
||||
lib boost_regex : $(SOURCES).cpp
|
||||
:
|
||||
<link>static:<define>BOOST_REGEX_NO_LIB=1
|
||||
<link>static:<define>BOOST_REGEX_STATIC_LINK=1
|
||||
<link>shared:<define>BOOST_RE_BUILD_DLL=1
|
||||
;
|
@ -35,7 +35,7 @@ BCROOT=$(MAKEDIR)\..
|
||||
!endif
|
||||
|
||||
|
||||
ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/detail/fileiter.hpp ../../../boost/regex/detail/instances.hpp ../../../boost/regex/detail/regex_compile.hpp ../../../boost/regex/detail/regex_cstring.hpp ../../../boost/regex/detail/regex_format.hpp ../../../boost/regex/detail/regex_kmp.hpp ../../../boost/regex/detail/regex_library_include.hpp ../../../boost/regex/detail/regex_match.hpp ../../../boost/regex/detail/regex_raw_buffer.hpp ../../../boost/regex/detail/regex_split.hpp ../../../boost/regex/detail/regex_stack.hpp ../../../boost/regex/detail/regex_synch.hpp
|
||||
ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/v3/fileiter.hpp ../../../boost/regex/v3/instances.hpp ../../../boost/regex/v3/regex_compile.hpp ../../../boost/regex/v3/regex_cstring.hpp ../../../boost/regex/v3/regex_format.hpp ../../../boost/regex/v3/regex_kmp.hpp ../../../boost/regex/v3/regex_library_include.hpp ../../../boost/regex/v3/regex_match.hpp ../../../boost/regex/v3/regex_raw_buffer.hpp ../../../boost/regex/v3/regex_split.hpp ../../../boost/regex/v3/regex_stack.hpp ../../../boost/regex/v3/regex_synch.hpp
|
||||
|
||||
all : bcb4 bcb4\boost_regex_bcb4_sss bcb4\boost_regex_bcb4_sss.lib bcb4\boost_regex_bcb4_mss bcb4\boost_regex_bcb4_mss.lib bcb4\boost_regex_bcb4_mdi bcb4\boost_regex_bcb4_mdi.lib bcb4\boost_regex_bcb4_sdi bcb4\boost_regex_bcb4_sdi.lib bcb4\boost_regex_bcb4_mds bcb4\boost_regex_bcb4_mds.lib bcb4\boost_regex_bcb4_sds bcb4\boost_regex_bcb4_sds.lib
|
||||
|
||||
@ -565,3 +565,4 @@ bcb4\boost_regex_bcb4_sds.lib : bcb4\boost_regex_bcb4_sds\c_regex_traits.obj bcb
|
||||
/P128 /C /u /a $(XSFLAGS) bcb4\boost_regex_bcb4_sds.lib -+bcb4\boost_regex_bcb4_sds\c_regex_traits.obj -+bcb4\boost_regex_bcb4_sds\c_regex_traits_common.obj -+bcb4\boost_regex_bcb4_sds\cpp_regex_traits.obj -+bcb4\boost_regex_bcb4_sds\cregex.obj -+bcb4\boost_regex_bcb4_sds\fileiter.obj -+bcb4\boost_regex_bcb4_sds\instances.obj -+bcb4\boost_regex_bcb4_sds\posix_api.obj -+bcb4\boost_regex_bcb4_sds\regex.obj -+bcb4\boost_regex_bcb4_sds\regex_debug.obj -+bcb4\boost_regex_bcb4_sds\regex_synch.obj -+bcb4\boost_regex_bcb4_sds\w32_regex_traits.obj -+bcb4\boost_regex_bcb4_sds\wide_posix_api.obj -+bcb4\boost_regex_bcb4_sds\winstances.obj
|
||||
|
|
||||
|
||||
|
||||
|
@ -35,7 +35,7 @@ BCROOT=$(MAKEDIR)\..
|
||||
!endif
|
||||
|
||||
|
||||
ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/detail/fileiter.hpp ../../../boost/regex/detail/instances.hpp ../../../boost/regex/detail/regex_compile.hpp ../../../boost/regex/detail/regex_cstring.hpp ../../../boost/regex/detail/regex_format.hpp ../../../boost/regex/detail/regex_kmp.hpp ../../../boost/regex/detail/regex_library_include.hpp ../../../boost/regex/detail/regex_match.hpp ../../../boost/regex/detail/regex_raw_buffer.hpp ../../../boost/regex/detail/regex_split.hpp ../../../boost/regex/detail/regex_stack.hpp ../../../boost/regex/detail/regex_synch.hpp
|
||||
ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/v3/fileiter.hpp ../../../boost/regex/v3/instances.hpp ../../../boost/regex/v3/regex_compile.hpp ../../../boost/regex/v3/regex_cstring.hpp ../../../boost/regex/v3/regex_format.hpp ../../../boost/regex/v3/regex_kmp.hpp ../../../boost/regex/v3/regex_library_include.hpp ../../../boost/regex/v3/regex_match.hpp ../../../boost/regex/v3/regex_raw_buffer.hpp ../../../boost/regex/v3/regex_split.hpp ../../../boost/regex/v3/regex_stack.hpp ../../../boost/regex/v3/regex_synch.hpp
|
||||
|
||||
all : bcb5 bcb5\boost_regex_bcb5_sss bcb5\boost_regex_bcb5_sss.lib bcb5\boost_regex_bcb5_mss bcb5\boost_regex_bcb5_mss.lib bcb5\boost_regex_bcb5_mdi bcb5\boost_regex_bcb5_mdi.lib bcb5\boost_regex_bcb5_sdi bcb5\boost_regex_bcb5_sdi.lib bcb5\boost_regex_bcb5_mds bcb5\boost_regex_bcb5_mds.lib bcb5\boost_regex_bcb5_sds bcb5\boost_regex_bcb5_sds.lib
|
||||
|
||||
@ -565,3 +565,4 @@ bcb5\boost_regex_bcb5_sds.lib : bcb5\boost_regex_bcb5_sds\c_regex_traits.obj bcb
|
||||
/P128 /C /u /a $(XSFLAGS) bcb5\boost_regex_bcb5_sds.lib -+bcb5\boost_regex_bcb5_sds\c_regex_traits.obj -+bcb5\boost_regex_bcb5_sds\c_regex_traits_common.obj -+bcb5\boost_regex_bcb5_sds\cpp_regex_traits.obj -+bcb5\boost_regex_bcb5_sds\cregex.obj -+bcb5\boost_regex_bcb5_sds\fileiter.obj -+bcb5\boost_regex_bcb5_sds\instances.obj -+bcb5\boost_regex_bcb5_sds\posix_api.obj -+bcb5\boost_regex_bcb5_sds\regex.obj -+bcb5\boost_regex_bcb5_sds\regex_debug.obj -+bcb5\boost_regex_bcb5_sds\regex_synch.obj -+bcb5\boost_regex_bcb5_sds\w32_regex_traits.obj -+bcb5\boost_regex_bcb5_sds\wide_posix_api.obj -+bcb5\boost_regex_bcb5_sds\winstances.obj
|
||||
|
|
||||
|
||||
|
||||
|
@ -35,7 +35,7 @@ BCROOT=$(MAKEDIR)\..
|
||||
!endif
|
||||
|
||||
|
||||
ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/detail/fileiter.hpp ../../../boost/regex/detail/instances.hpp ../../../boost/regex/detail/regex_compile.hpp ../../../boost/regex/detail/regex_cstring.hpp ../../../boost/regex/detail/regex_format.hpp ../../../boost/regex/detail/regex_kmp.hpp ../../../boost/regex/detail/regex_library_include.hpp ../../../boost/regex/detail/regex_match.hpp ../../../boost/regex/detail/regex_raw_buffer.hpp ../../../boost/regex/detail/regex_split.hpp ../../../boost/regex/detail/regex_stack.hpp ../../../boost/regex/detail/regex_synch.hpp
|
||||
ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/v3/fileiter.hpp ../../../boost/regex/v3/instances.hpp ../../../boost/regex/v3/regex_compile.hpp ../../../boost/regex/v3/regex_cstring.hpp ../../../boost/regex/v3/regex_format.hpp ../../../boost/regex/v3/regex_kmp.hpp ../../../boost/regex/v3/regex_library_include.hpp ../../../boost/regex/v3/regex_match.hpp ../../../boost/regex/v3/regex_raw_buffer.hpp ../../../boost/regex/v3/regex_split.hpp ../../../boost/regex/v3/regex_stack.hpp ../../../boost/regex/v3/regex_synch.hpp
|
||||
|
||||
all : bcb6 bcb6\boost_regex_bcb6_sss bcb6\boost_regex_bcb6_sss.lib bcb6\boost_regex_bcb6_mss bcb6\boost_regex_bcb6_mss.lib bcb6\boost_regex_bcb6_mdi bcb6\boost_regex_bcb6_mdi.lib bcb6\boost_regex_bcb6_sdi bcb6\boost_regex_bcb6_sdi.lib bcb6\boost_regex_bcb6_mds bcb6\boost_regex_bcb6_mds.lib bcb6\boost_regex_bcb6_sds bcb6\boost_regex_bcb6_sds.lib bcb6\boost_regex_bcb6_sssdd bcb6\boost_regex_bcb6_sssdd.lib bcb6\boost_regex_bcb6_mssdd bcb6\boost_regex_bcb6_mssdd.lib bcb6\boost_regex_bcb6_mdidd bcb6\boost_regex_bcb6_mdidd.lib bcb6\boost_regex_bcb6_sdidd bcb6\boost_regex_bcb6_sdidd.lib bcb6\boost_regex_bcb6_mdsdd bcb6\boost_regex_bcb6_mdsdd.lib bcb6\boost_regex_bcb6_sdsdd bcb6\boost_regex_bcb6_sdsdd.lib
|
||||
|
||||
@ -1083,3 +1083,4 @@ bcb6\boost_regex_bcb6_sdsdd.lib : bcb6\boost_regex_bcb6_sdsdd\c_regex_traits.obj
|
||||
/P128 /C /u /a $(XSFLAGS) bcb6\boost_regex_bcb6_sdsdd.lib -+bcb6\boost_regex_bcb6_sdsdd\c_regex_traits.obj -+bcb6\boost_regex_bcb6_sdsdd\c_regex_traits_common.obj -+bcb6\boost_regex_bcb6_sdsdd\cpp_regex_traits.obj -+bcb6\boost_regex_bcb6_sdsdd\cregex.obj -+bcb6\boost_regex_bcb6_sdsdd\fileiter.obj -+bcb6\boost_regex_bcb6_sdsdd\instances.obj -+bcb6\boost_regex_bcb6_sdsdd\posix_api.obj -+bcb6\boost_regex_bcb6_sdsdd\regex.obj -+bcb6\boost_regex_bcb6_sdsdd\regex_debug.obj -+bcb6\boost_regex_bcb6_sdsdd\regex_synch.obj -+bcb6\boost_regex_bcb6_sdsdd\w32_regex_traits.obj -+bcb6\boost_regex_bcb6_sdsdd\wide_posix_api.obj -+bcb6\boost_regex_bcb6_sdsdd\winstances.obj
|
||||
|
|
||||
|
||||
|
||||
|
@ -6,13 +6,13 @@ for file in ../../../boost/regex/*.hpp ; do
|
||||
fi
|
||||
done
|
||||
|
||||
for file in ../../../boost/regex/detail/*.hpp; do
|
||||
for file in ../../../boost/regex/v3/*.hpp; do
|
||||
if [ -f $file ]; then
|
||||
header="$header $file"
|
||||
fi
|
||||
done
|
||||
|
||||
for file in ../../../boost/regex/detail/*.hxx; do
|
||||
for file in ../../../boost/regex/v3/*.hxx; do
|
||||
if [ -f $file ]; then
|
||||
header="$header $file"
|
||||
fi
|
||||
@ -26,3 +26,4 @@ for file in ../src/*.cpp; do
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
|
@ -29,7 +29,7 @@ C1=-c -O2 -I../../../ -fPIC
|
||||
C2=-c -g -I../../../ -fPIC
|
||||
|
||||
|
||||
ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/detail/fileiter.hpp ../../../boost/regex/detail/instances.hpp ../../../boost/regex/detail/regex_compile.hpp ../../../boost/regex/detail/regex_cstring.hpp ../../../boost/regex/detail/regex_format.hpp ../../../boost/regex/detail/regex_kmp.hpp ../../../boost/regex/detail/regex_library_include.hpp ../../../boost/regex/detail/regex_match.hpp ../../../boost/regex/detail/regex_raw_buffer.hpp ../../../boost/regex/detail/regex_split.hpp ../../../boost/regex/detail/regex_stack.hpp ../../../boost/regex/detail/regex_synch.hpp
|
||||
ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/v3/fileiter.hpp ../../../boost/regex/v3/instances.hpp ../../../boost/regex/v3/regex_compile.hpp ../../../boost/regex/v3/regex_cstring.hpp ../../../boost/regex/v3/regex_format.hpp ../../../boost/regex/v3/regex_kmp.hpp ../../../boost/regex/v3/regex_library_include.hpp ../../../boost/regex/v3/regex_match.hpp ../../../boost/regex/v3/regex_raw_buffer.hpp ../../../boost/regex/v3/regex_split.hpp ../../../boost/regex/v3/regex_stack.hpp ../../../boost/regex/v3/regex_synch.hpp
|
||||
|
||||
all : gcc gcc gcc/boost_regex_shared ./gcc/libboost_regex.so gcc gcc/boost_regex_debug_shared ./gcc/libboost_regex_debug.so
|
||||
|
||||
@ -148,3 +148,4 @@ boost_regex_debug_clean :
|
||||
./gcc/libboost_regex_debug.so : gcc/boost_regex_debug_shared/c_regex_traits.o gcc/boost_regex_debug_shared/c_regex_traits_common.o gcc/boost_regex_debug_shared/cpp_regex_traits.o gcc/boost_regex_debug_shared/cregex.o gcc/boost_regex_debug_shared/fileiter.o gcc/boost_regex_debug_shared/instances.o gcc/boost_regex_debug_shared/posix_api.o gcc/boost_regex_debug_shared/regex.o gcc/boost_regex_debug_shared/regex_debug.o gcc/boost_regex_debug_shared/regex_synch.o gcc/boost_regex_debug_shared/w32_regex_traits.o gcc/boost_regex_debug_shared/wide_posix_api.o gcc/boost_regex_debug_shared/winstances.o
|
||||
$(LINKER) -o gcc/libboost_regex_debug.so $(LDFLAGS) gcc/boost_regex_debug_shared/c_regex_traits.o gcc/boost_regex_debug_shared/c_regex_traits_common.o gcc/boost_regex_debug_shared/cpp_regex_traits.o gcc/boost_regex_debug_shared/cregex.o gcc/boost_regex_debug_shared/fileiter.o gcc/boost_regex_debug_shared/instances.o gcc/boost_regex_debug_shared/posix_api.o gcc/boost_regex_debug_shared/regex.o gcc/boost_regex_debug_shared/regex_debug.o gcc/boost_regex_debug_shared/regex_synch.o gcc/boost_regex_debug_shared/w32_regex_traits.o gcc/boost_regex_debug_shared/wide_posix_api.o gcc/boost_regex_debug_shared/winstances.o $(LIBS)
|
||||
|
||||
|
||||
|
@ -30,7 +30,7 @@ C2=-c -g -I../../../
|
||||
|
||||
|
||||
|
||||
ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/detail/fileiter.hpp ../../../boost/regex/detail/instances.hpp ../../../boost/regex/detail/regex_compile.hpp ../../../boost/regex/detail/regex_cstring.hpp ../../../boost/regex/detail/regex_format.hpp ../../../boost/regex/detail/regex_kmp.hpp ../../../boost/regex/detail/regex_library_include.hpp ../../../boost/regex/detail/regex_match.hpp ../../../boost/regex/detail/regex_raw_buffer.hpp ../../../boost/regex/detail/regex_split.hpp ../../../boost/regex/detail/regex_stack.hpp ../../../boost/regex/detail/regex_synch.hpp
|
||||
ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/v3/fileiter.hpp ../../../boost/regex/v3/instances.hpp ../../../boost/regex/v3/regex_compile.hpp ../../../boost/regex/v3/regex_cstring.hpp ../../../boost/regex/v3/regex_format.hpp ../../../boost/regex/v3/regex_kmp.hpp ../../../boost/regex/v3/regex_library_include.hpp ../../../boost/regex/v3/regex_match.hpp ../../../boost/regex/v3/regex_raw_buffer.hpp ../../../boost/regex/v3/regex_split.hpp ../../../boost/regex/v3/regex_stack.hpp ../../../boost/regex/v3/regex_synch.hpp
|
||||
|
||||
all : gcc gcc gcc/boost_regex ./gcc/libboost_regex.a gcc gcc/boost_regex_debug ./gcc/libboost_regex_debug.a
|
||||
|
||||
@ -151,3 +151,4 @@ boost_regex_debug_clean :
|
||||
ar -r gcc/libboost_regex_debug.a gcc/boost_regex_debug/c_regex_traits.o gcc/boost_regex_debug/c_regex_traits_common.o gcc/boost_regex_debug/cpp_regex_traits.o gcc/boost_regex_debug/cregex.o gcc/boost_regex_debug/fileiter.o gcc/boost_regex_debug/instances.o gcc/boost_regex_debug/posix_api.o gcc/boost_regex_debug/regex.o gcc/boost_regex_debug/regex_debug.o gcc/boost_regex_debug/regex_synch.o gcc/boost_regex_debug/w32_regex_traits.o gcc/boost_regex_debug/wide_posix_api.o gcc/boost_regex_debug/winstances.o
|
||||
-ar -s gcc/libboost_regex_debug.a
|
||||
|
||||
|
||||
|
@ -26,7 +26,7 @@ C1=-c -O2 -I../../../
|
||||
|
||||
|
||||
|
||||
ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/detail/fileiter.hpp ../../../boost/regex/detail/instances.hpp ../../../boost/regex/detail/regex_compile.hpp ../../../boost/regex/detail/regex_cstring.hpp ../../../boost/regex/detail/regex_format.hpp ../../../boost/regex/detail/regex_kmp.hpp ../../../boost/regex/detail/regex_library_include.hpp ../../../boost/regex/detail/regex_match.hpp ../../../boost/regex/detail/regex_raw_buffer.hpp ../../../boost/regex/detail/regex_split.hpp ../../../boost/regex/detail/regex_stack.hpp ../../../boost/regex/detail/regex_synch.hpp
|
||||
ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/v3/fileiter.hpp ../../../boost/regex/v3/instances.hpp ../../../boost/regex/v3/regex_compile.hpp ../../../boost/regex/v3/regex_cstring.hpp ../../../boost/regex/v3/regex_format.hpp ../../../boost/regex/v3/regex_kmp.hpp ../../../boost/regex/v3/regex_library_include.hpp ../../../boost/regex/v3/regex_match.hpp ../../../boost/regex/v3/regex_raw_buffer.hpp ../../../boost/regex/v3/regex_split.hpp ../../../boost/regex/v3/regex_stack.hpp ../../../boost/regex/v3/regex_synch.hpp
|
||||
|
||||
all : $(DIRNAME) $(DIRNAME) $(DIRNAME)/boost_regex ./$(DIRNAME)/libboost_regex.so
|
||||
|
||||
@ -92,3 +92,4 @@ boost_regex_clean :
|
||||
./$(DIRNAME)/libboost_regex.so : $(DIRNAME)/boost_regex/c_regex_traits.o $(DIRNAME)/boost_regex/c_regex_traits_common.o $(DIRNAME)/boost_regex/cpp_regex_traits.o $(DIRNAME)/boost_regex/cregex.o $(DIRNAME)/boost_regex/fileiter.o $(DIRNAME)/boost_regex/instances.o $(DIRNAME)/boost_regex/posix_api.o $(DIRNAME)/boost_regex/regex.o $(DIRNAME)/boost_regex/regex_debug.o $(DIRNAME)/boost_regex/regex_synch.o $(DIRNAME)/boost_regex/w32_regex_traits.o $(DIRNAME)/boost_regex/wide_posix_api.o $(DIRNAME)/boost_regex/winstances.o
|
||||
$(LINKER) $(LDFLAGS) -o $(DIRNAME)/libboost_regex.so $(DIRNAME)/boost_regex/c_regex_traits.o $(DIRNAME)/boost_regex/c_regex_traits_common.o $(DIRNAME)/boost_regex/cpp_regex_traits.o $(DIRNAME)/boost_regex/cregex.o $(DIRNAME)/boost_regex/fileiter.o $(DIRNAME)/boost_regex/instances.o $(DIRNAME)/boost_regex/posix_api.o $(DIRNAME)/boost_regex/regex.o $(DIRNAME)/boost_regex/regex_debug.o $(DIRNAME)/boost_regex/regex_synch.o $(DIRNAME)/boost_regex/w32_regex_traits.o $(DIRNAME)/boost_regex/wide_posix_api.o $(DIRNAME)/boost_regex/winstances.o $(LIBS)
|
||||
|
||||
|
||||
|
@ -34,7 +34,7 @@ SUNWS_CACHE_NAME=SunWS_cache
|
||||
|
||||
|
||||
|
||||
ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/detail/fileiter.hpp ../../../boost/regex/detail/instances.hpp ../../../boost/regex/detail/regex_compile.hpp ../../../boost/regex/detail/regex_cstring.hpp ../../../boost/regex/detail/regex_format.hpp ../../../boost/regex/detail/regex_kmp.hpp ../../../boost/regex/detail/regex_library_include.hpp ../../../boost/regex/detail/regex_match.hpp ../../../boost/regex/detail/regex_raw_buffer.hpp ../../../boost/regex/detail/regex_split.hpp ../../../boost/regex/detail/regex_stack.hpp ../../../boost/regex/detail/regex_synch.hpp
|
||||
ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/v3/fileiter.hpp ../../../boost/regex/v3/instances.hpp ../../../boost/regex/v3/regex_compile.hpp ../../../boost/regex/v3/regex_cstring.hpp ../../../boost/regex/v3/regex_format.hpp ../../../boost/regex/v3/regex_kmp.hpp ../../../boost/regex/v3/regex_library_include.hpp ../../../boost/regex/v3/regex_match.hpp ../../../boost/regex/v3/regex_raw_buffer.hpp ../../../boost/regex/v3/regex_split.hpp ../../../boost/regex/v3/regex_stack.hpp ../../../boost/regex/v3/regex_synch.hpp
|
||||
|
||||
all : sunpro sunpro/libboost_regex$(LIBSUFFIX) sunpro/libboost_regex$(LIBSUFFIX).a sunpro/libboost_regex_mt$(LIBSUFFIX) sunpro/libboost_regex_mt$(LIBSUFFIX).a sunpro/shared_libboost_regex$(LIBSUFFIX) sunpro/libboost_regex$(LIBSUFFIX).so sunpro/shared_libboost_regex_mt$(LIBSUFFIX) sunpro/libboost_regex_mt$(LIBSUFFIX).so
|
||||
|
||||
@ -262,3 +262,4 @@ libboost_regex_mt$(LIBSUFFIX)_clean_shared :
|
||||
sunpro/libboost_regex_mt$(LIBSUFFIX).so : sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/c_regex_traits.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/c_regex_traits_common.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/cpp_regex_traits.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/cregex.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/fileiter.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/instances.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/posix_api.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/regex.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/regex_debug.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/regex_synch.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/w32_regex_traits.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/wide_posix_api.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/winstances.o
|
||||
CC -KPIC -O2 -mt -I../../../ -G -o sunpro/libboost_regex_mt$(LIBSUFFIX).so $(LDFLAGS) sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/c_regex_traits.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/c_regex_traits_common.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/cpp_regex_traits.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/cregex.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/fileiter.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/instances.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/posix_api.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/regex.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/regex_debug.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/regex_synch.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/w32_regex_traits.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/wide_posix_api.o sunpro/shared_libboost_regex_mt$(LIBSUFFIX)/winstances.o $(LIBS)
|
||||
|
||||
|
||||
|
@ -40,7 +40,7 @@ NULL=nul
|
||||
!ENDIF
|
||||
|
||||
|
||||
ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/detail/fileiter.hpp ../../../boost/regex/detail/instances.hpp ../../../boost/regex/detail/regex_compile.hpp ../../../boost/regex/detail/regex_cstring.hpp ../../../boost/regex/detail/regex_format.hpp ../../../boost/regex/detail/regex_kmp.hpp ../../../boost/regex/detail/regex_library_include.hpp ../../../boost/regex/detail/regex_match.hpp ../../../boost/regex/detail/regex_raw_buffer.hpp ../../../boost/regex/detail/regex_split.hpp ../../../boost/regex/detail/regex_stack.hpp ../../../boost/regex/detail/regex_synch.hpp
|
||||
ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/v3/fileiter.hpp ../../../boost/regex/v3/instances.hpp ../../../boost/regex/v3/regex_compile.hpp ../../../boost/regex/v3/regex_cstring.hpp ../../../boost/regex/v3/regex_format.hpp ../../../boost/regex/v3/regex_kmp.hpp ../../../boost/regex/v3/regex_library_include.hpp ../../../boost/regex/v3/regex_match.hpp ../../../boost/regex/v3/regex_raw_buffer.hpp ../../../boost/regex/v3/regex_split.hpp ../../../boost/regex/v3/regex_stack.hpp ../../../boost/regex/v3/regex_synch.hpp
|
||||
|
||||
all : main_dir boost_regex_vc6-stlport_mss_dir ./vc6-stlport/boost_regex_vc6-stlport_mss.lib boost_regex_vc6-stlport_mssd_dir ./vc6-stlport/boost_regex_vc6-stlport_mssd.lib boost_regex_vc6-stlport_mdid_dir ./vc6-stlport/boost_regex_vc6-stlport_mdid.lib boost_regex_vc6-stlport_mdi_dir ./vc6-stlport/boost_regex_vc6-stlport_mdi.lib boost_regex_vc6-stlport_mds_dir ./vc6-stlport/boost_regex_vc6-stlport_mds.lib boost_regex_vc6-stlport_mdsd_dir ./vc6-stlport/boost_regex_vc6-stlport_mdsd.lib boost_regex_vc6-stlport_mdidd_dir ./vc6-stlport/boost_regex_vc6-stlport_mdidd.lib boost_regex_vc6-stlport_mssdd_dir ./vc6-stlport/boost_regex_vc6-stlport_mssdd.lib boost_regex_vc6-stlport_mdsdd_dir ./vc6-stlport/boost_regex_vc6-stlport_mdsdd.lib
|
||||
|
||||
@ -574,3 +574,4 @@ boost_regex_vc6-stlport_mdsdd_clean :
|
||||
./vc6-stlport/boost_regex_vc6-stlport_mdsdd.lib : vc6-stlport/boost_regex_vc6-stlport_mdsdd/c_regex_traits.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/c_regex_traits_common.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/cpp_regex_traits.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/cregex.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/fileiter.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/instances.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/posix_api.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/regex.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/regex_debug.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/regex_synch.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/w32_regex_traits.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/wide_posix_api.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/winstances.obj
|
||||
link -lib /nologo /out:vc6-stlport/boost_regex_vc6-stlport_mdsdd.lib $(XSFLAGS) vc6-stlport/boost_regex_vc6-stlport_mdsdd/c_regex_traits.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/c_regex_traits_common.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/cpp_regex_traits.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/cregex.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/fileiter.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/instances.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/posix_api.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/regex.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/regex_debug.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/regex_synch.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/w32_regex_traits.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/wide_posix_api.obj vc6-stlport/boost_regex_vc6-stlport_mdsdd/winstances.obj
|
||||
|
||||
|
||||
|
@ -36,7 +36,7 @@ NULL=nul
|
||||
!ENDIF
|
||||
|
||||
|
||||
ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/detail/fileiter.hpp ../../../boost/regex/detail/instances.hpp ../../../boost/regex/detail/regex_compile.hpp ../../../boost/regex/detail/regex_cstring.hpp ../../../boost/regex/detail/regex_format.hpp ../../../boost/regex/detail/regex_kmp.hpp ../../../boost/regex/detail/regex_library_include.hpp ../../../boost/regex/detail/regex_match.hpp ../../../boost/regex/detail/regex_raw_buffer.hpp ../../../boost/regex/detail/regex_split.hpp ../../../boost/regex/detail/regex_stack.hpp ../../../boost/regex/detail/regex_synch.hpp
|
||||
ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/v3/fileiter.hpp ../../../boost/regex/v3/instances.hpp ../../../boost/regex/v3/regex_compile.hpp ../../../boost/regex/v3/regex_cstring.hpp ../../../boost/regex/v3/regex_format.hpp ../../../boost/regex/v3/regex_kmp.hpp ../../../boost/regex/v3/regex_library_include.hpp ../../../boost/regex/v3/regex_match.hpp ../../../boost/regex/v3/regex_raw_buffer.hpp ../../../boost/regex/v3/regex_split.hpp ../../../boost/regex/v3/regex_stack.hpp ../../../boost/regex/v3/regex_synch.hpp
|
||||
|
||||
all : main_dir boost_regex_vc6_sss_dir ./vc6/boost_regex_vc6_sss.lib boost_regex_vc6_mss_dir ./vc6/boost_regex_vc6_mss.lib boost_regex_vc6_sssd_dir ./vc6/boost_regex_vc6_sssd.lib boost_regex_vc6_mssd_dir ./vc6/boost_regex_vc6_mssd.lib boost_regex_vc6_mdid_dir ./vc6/boost_regex_vc6_mdid.lib boost_regex_vc6_mdi_dir ./vc6/boost_regex_vc6_mdi.lib boost_regex_vc6_mds_dir ./vc6/boost_regex_vc6_mds.lib boost_regex_vc6_mdsd_dir ./vc6/boost_regex_vc6_mdsd.lib
|
||||
|
||||
@ -510,3 +510,5 @@ boost_regex_vc6_mdsd_clean :
|
||||
./vc6/boost_regex_vc6_mdsd.lib : vc6/boost_regex_vc6_mdsd/c_regex_traits.obj vc6/boost_regex_vc6_mdsd/c_regex_traits_common.obj vc6/boost_regex_vc6_mdsd/cpp_regex_traits.obj vc6/boost_regex_vc6_mdsd/cregex.obj vc6/boost_regex_vc6_mdsd/fileiter.obj vc6/boost_regex_vc6_mdsd/instances.obj vc6/boost_regex_vc6_mdsd/posix_api.obj vc6/boost_regex_vc6_mdsd/regex.obj vc6/boost_regex_vc6_mdsd/regex_debug.obj vc6/boost_regex_vc6_mdsd/regex_synch.obj vc6/boost_regex_vc6_mdsd/w32_regex_traits.obj vc6/boost_regex_vc6_mdsd/wide_posix_api.obj vc6/boost_regex_vc6_mdsd/winstances.obj
|
||||
link -lib /nologo /out:vc6/boost_regex_vc6_mdsd.lib $(XSFLAGS) vc6/boost_regex_vc6_mdsd/c_regex_traits.obj vc6/boost_regex_vc6_mdsd/c_regex_traits_common.obj vc6/boost_regex_vc6_mdsd/cpp_regex_traits.obj vc6/boost_regex_vc6_mdsd/cregex.obj vc6/boost_regex_vc6_mdsd/fileiter.obj vc6/boost_regex_vc6_mdsd/instances.obj vc6/boost_regex_vc6_mdsd/posix_api.obj vc6/boost_regex_vc6_mdsd/regex.obj vc6/boost_regex_vc6_mdsd/regex_debug.obj vc6/boost_regex_vc6_mdsd/regex_synch.obj vc6/boost_regex_vc6_mdsd/w32_regex_traits.obj vc6/boost_regex_vc6_mdsd/wide_posix_api.obj vc6/boost_regex_vc6_mdsd/winstances.obj
|
||||
|
||||
|
||||
|
||||
|
@ -36,7 +36,7 @@ NULL=nul
|
||||
!ENDIF
|
||||
|
||||
|
||||
ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/detail/fileiter.hpp ../../../boost/regex/detail/instances.hpp ../../../boost/regex/detail/regex_compile.hpp ../../../boost/regex/detail/regex_cstring.hpp ../../../boost/regex/detail/regex_format.hpp ../../../boost/regex/detail/regex_kmp.hpp ../../../boost/regex/detail/regex_library_include.hpp ../../../boost/regex/detail/regex_match.hpp ../../../boost/regex/detail/regex_raw_buffer.hpp ../../../boost/regex/detail/regex_split.hpp ../../../boost/regex/detail/regex_stack.hpp ../../../boost/regex/detail/regex_synch.hpp
|
||||
ALL_HEADER= ../../../boost/regex/config.hpp ../../../boost/regex/pattern_except.hpp ../../../boost/regex/regex_traits.hpp ../../../boost/regex/user.hpp ../../../boost/regex/v3/fileiter.hpp ../../../boost/regex/v3/instances.hpp ../../../boost/regex/v3/regex_compile.hpp ../../../boost/regex/v3/regex_cstring.hpp ../../../boost/regex/v3/regex_format.hpp ../../../boost/regex/v3/regex_kmp.hpp ../../../boost/regex/v3/regex_library_include.hpp ../../../boost/regex/v3/regex_match.hpp ../../../boost/regex/v3/regex_raw_buffer.hpp ../../../boost/regex/v3/regex_split.hpp ../../../boost/regex/v3/regex_stack.hpp ../../../boost/regex/v3/regex_synch.hpp
|
||||
|
||||
all : main_dir boost_regex_vc7_sss_dir ./vc7/boost_regex_vc7_sss.lib boost_regex_vc7_mss_dir ./vc7/boost_regex_vc7_mss.lib boost_regex_vc7_sssd_dir ./vc7/boost_regex_vc7_sssd.lib boost_regex_vc7_mssd_dir ./vc7/boost_regex_vc7_mssd.lib boost_regex_vc7_mdid_dir ./vc7/boost_regex_vc7_mdid.lib boost_regex_vc7_mdi_dir ./vc7/boost_regex_vc7_mdi.lib boost_regex_vc7_mds_dir ./vc7/boost_regex_vc7_mds.lib boost_regex_vc7_mdsd_dir ./vc7/boost_regex_vc7_mdsd.lib
|
||||
|
||||
@ -510,3 +510,4 @@ boost_regex_vc7_mdsd_clean :
|
||||
./vc7/boost_regex_vc7_mdsd.lib : vc7/boost_regex_vc7_mdsd/c_regex_traits.obj vc7/boost_regex_vc7_mdsd/c_regex_traits_common.obj vc7/boost_regex_vc7_mdsd/cpp_regex_traits.obj vc7/boost_regex_vc7_mdsd/cregex.obj vc7/boost_regex_vc7_mdsd/fileiter.obj vc7/boost_regex_vc7_mdsd/instances.obj vc7/boost_regex_vc7_mdsd/posix_api.obj vc7/boost_regex_vc7_mdsd/regex.obj vc7/boost_regex_vc7_mdsd/regex_debug.obj vc7/boost_regex_vc7_mdsd/regex_synch.obj vc7/boost_regex_vc7_mdsd/w32_regex_traits.obj vc7/boost_regex_vc7_mdsd/wide_posix_api.obj vc7/boost_regex_vc7_mdsd/winstances.obj
|
||||
link -lib /nologo /out:vc7/boost_regex_vc7_mdsd.lib $(XSFLAGS) vc7/boost_regex_vc7_mdsd/c_regex_traits.obj vc7/boost_regex_vc7_mdsd/c_regex_traits_common.obj vc7/boost_regex_vc7_mdsd/cpp_regex_traits.obj vc7/boost_regex_vc7_mdsd/cregex.obj vc7/boost_regex_vc7_mdsd/fileiter.obj vc7/boost_regex_vc7_mdsd/instances.obj vc7/boost_regex_vc7_mdsd/posix_api.obj vc7/boost_regex_vc7_mdsd/regex.obj vc7/boost_regex_vc7_mdsd/regex_debug.obj vc7/boost_regex_vc7_mdsd/regex_synch.obj vc7/boost_regex_vc7_mdsd/w32_regex_traits.obj vc7/boost_regex_vc7_mdsd/wide_posix_api.obj vc7/boost_regex_vc7_mdsd/winstances.obj
|
||||
|
||||
|
||||
|
221
example/Jamfile
221
example/Jamfile
@ -4,195 +4,46 @@ subproject libs/regex/example ;
|
||||
SEARCH on testing.jam = $(BOOST_BUILD_PATH) ;
|
||||
include testing.jam ;
|
||||
|
||||
run timer/regex_timer.cpp
|
||||
<lib>../build/boost_regex$(SUFLIB)
|
||||
:
|
||||
timer/input_script.txt
|
||||
:
|
||||
:
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
:
|
||||
regex_timer
|
||||
;
|
||||
|
||||
run jgrep/jgrep.cpp jgrep/main.cpp
|
||||
<lib>../build/boost_regex$(SUFLIB)
|
||||
:
|
||||
-n boost/ ../../../boost/regex.hpp
|
||||
:
|
||||
:
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
:
|
||||
jgrep
|
||||
;
|
||||
|
||||
run snippets/credit_card_example.cpp
|
||||
<lib>../build/boost_regex$(SUFLIB)
|
||||
:
|
||||
:
|
||||
:
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
:
|
||||
credit_card_example
|
||||
;
|
||||
|
||||
|
||||
run snippets/partial_regex_grep.cpp
|
||||
<lib>../build/boost_regex$(SUFLIB)
|
||||
:
|
||||
../index.htm
|
||||
:
|
||||
:
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
:
|
||||
partial_regex_grep
|
||||
;
|
||||
|
||||
run snippets/partial_regex_match.cpp
|
||||
<lib>../build/boost_regex$(SUFLIB)
|
||||
:
|
||||
1234-5678-8765-4
|
||||
:
|
||||
:
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
:
|
||||
partial_regex_match
|
||||
;
|
||||
|
||||
run snippets/regex_grep_example_1.cpp
|
||||
<lib>../build/boost_regex$(SUFLIB)
|
||||
:
|
||||
../../../boost/rational.hpp
|
||||
:
|
||||
:
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
:
|
||||
regex_grep_example_1
|
||||
;
|
||||
|
||||
run snippets/regex_grep_example_2.cpp
|
||||
<lib>../build/boost_regex$(SUFLIB)
|
||||
:
|
||||
../../../boost/rational.hpp
|
||||
:
|
||||
:
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
:
|
||||
regex_grep_example_2
|
||||
;
|
||||
|
||||
run snippets/regex_grep_example_3.cpp
|
||||
<lib>../build/boost_regex$(SUFLIB)
|
||||
:
|
||||
../../../boost/rational.hpp
|
||||
:
|
||||
:
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
:
|
||||
regex_grep_example_3
|
||||
;
|
||||
|
||||
run snippets/regex_grep_example_4.cpp
|
||||
<lib>../build/boost_regex$(SUFLIB)
|
||||
:
|
||||
../../../boost/rational.hpp
|
||||
:
|
||||
:
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
:
|
||||
regex_grep_example_4
|
||||
;
|
||||
|
||||
run snippets/regex_match_example.cpp
|
||||
<lib>../build/boost_regex$(SUFLIB)
|
||||
:
|
||||
-auto
|
||||
:
|
||||
:
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
:
|
||||
regex_match_example
|
||||
;
|
||||
|
||||
run snippets/regex_merge_example.cpp
|
||||
<lib>../build/boost_regex$(SUFLIB)
|
||||
:
|
||||
../../../boost/rational.hpp
|
||||
:
|
||||
:
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
:
|
||||
regex_merge_example
|
||||
;
|
||||
|
||||
run snippets/regex_search_example.cpp
|
||||
<lib>../build/boost_regex$(SUFLIB)
|
||||
:
|
||||
../../../boost/rational.hpp
|
||||
:
|
||||
:
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
:
|
||||
regex_search_example
|
||||
;
|
||||
|
||||
run snippets/regex_split_example_1.cpp
|
||||
<lib>../build/boost_regex$(SUFLIB)
|
||||
:
|
||||
-auto
|
||||
:
|
||||
:
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
:
|
||||
regex_split_example_1
|
||||
;
|
||||
|
||||
run snippets/regex_split_example_2.cpp
|
||||
<lib>../build/boost_regex$(SUFLIB)
|
||||
:
|
||||
../index.htm
|
||||
:
|
||||
:
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
:
|
||||
regex_split_example_2
|
||||
;
|
||||
|
||||
|
||||
|
||||
|
||||
rule regex-test-run ( sources + : input * )
|
||||
{
|
||||
return [
|
||||
run
|
||||
# sources
|
||||
$(sources)
|
||||
|
||||
# dependencies
|
||||
<lib>../build/boost_regex
|
||||
: # additional args
|
||||
$(input)
|
||||
: # test-files
|
||||
: # requirements
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
<threading>multi
|
||||
std::facet-support
|
||||
: # test name
|
||||
] ;
|
||||
}
|
||||
|
||||
test-suite regex-examples :
|
||||
|
||||
[ regex-test-run timer/regex_timer.cpp : $(BOOST_ROOT)/libs/regex/example/timer/input_script.txt ]
|
||||
[ regex-test-run jgrep/jgrep.cpp jgrep/main.cpp : -n boost/ $(BOOST_ROOT)/boost/regex.hpp ]
|
||||
[ regex-test-run snippets/credit_card_example.cpp ]
|
||||
[ regex-test-run snippets/partial_regex_grep.cpp : $(BOOST_ROOT)/libs/regex/index.htm ]
|
||||
[ regex-test-run snippets/partial_regex_match.cpp : 1234-5678-8765-4 ]
|
||||
[ regex-test-run snippets/regex_grep_example_1.cpp : $(BOOST_ROOT)/boost/rational.hpp ]
|
||||
[ regex-test-run snippets/regex_grep_example_2.cpp : $(BOOST_ROOT)/boost/rational.hpp ]
|
||||
[ regex-test-run snippets/regex_grep_example_3.cpp : $(BOOST_ROOT)/boost/rational.hpp ]
|
||||
[ regex-test-run snippets/regex_grep_example_4.cpp : $(BOOST_ROOT)/boost/rational.hpp ]
|
||||
[ regex-test-run snippets/regex_match_example.cpp : -auto ]
|
||||
[ regex-test-run snippets/regex_merge_example.cpp : $(BOOST_ROOT)/boost/rational.hpp ]
|
||||
[ regex-test-run snippets/regex_search_example.cpp : $(BOOST_ROOT)/boost/rational.hpp ]
|
||||
[ regex-test-run snippets/regex_split_example_1.cpp : -auto ]
|
||||
[ regex-test-run snippets/regex_split_example_2.cpp : $(BOOST_ROOT)/libs/regex/index.htm ]
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
||||
|
@ -33,7 +33,7 @@ using std::endl;
|
||||
# pragma hrdstop
|
||||
#endif
|
||||
|
||||
#include <boost/regex/detail/fileiter.hpp>
|
||||
#include <boost/regex/v3/fileiter.hpp>
|
||||
|
||||
#include "jgrep.h"
|
||||
|
||||
@ -137,3 +137,4 @@ void process_grep(const char* file)
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -34,7 +34,7 @@ using std::endl;
|
||||
# pragma hrdstop
|
||||
#endif
|
||||
|
||||
#include <boost/regex/detail/fileiter.hpp>
|
||||
#include <boost/regex/v3/fileiter.hpp>
|
||||
#include "jgrep.h"
|
||||
|
||||
#ifndef JM_ALGO_INCLUDED
|
||||
@ -286,3 +286,4 @@ int main(int argc, char * argv[])
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -13,6 +13,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
#include <deque>
|
||||
#include <iterator>
|
||||
|
||||
#ifdef BOOST_RE_OLD_IOSTREAM
|
||||
#include <iostream.h>
|
||||
#include <fstream.h>
|
||||
@ -27,19 +32,16 @@ using std::ostream;
|
||||
using std::endl;
|
||||
using std::ifstream;
|
||||
using std::streambuf;
|
||||
using std::getline;
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
#include <deque>
|
||||
#include <iterator>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
#include <boost/timer.hpp>
|
||||
#include <boost/smart_ptr.hpp>
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
// no Koenig lookup, use using declaration instead:
|
||||
#if defined(_MSC_VER) && (_MSC_VER <= 1300)
|
||||
// maybe no Koenig lookup, use using declaration instead:
|
||||
using namespace boost;
|
||||
#endif
|
||||
|
||||
@ -360,3 +362,5 @@ int main(int argc, char**argv)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* LOCATION: see http://www.boost.org/libs/regex for most recent version.
|
||||
* FILE cregex.cpp
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Declares POSIX API functions
|
||||
@ -24,283 +24,7 @@
|
||||
#ifndef BOOST_RE_CREGEX_HPP
|
||||
#define BOOST_RE_CREGEX_HPP
|
||||
|
||||
#include <boost/regex/config.hpp>
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma option push -a8 -b -Vx -Ve -pc
|
||||
#endif
|
||||
|
||||
/* include these defs only for POSIX compatablity */
|
||||
#ifdef __cplusplus
|
||||
namespace boost{
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && !defined(BOOST_NO_STDC_NAMESPACE)
|
||||
typedef std::ptrdiff_t regoff_t;
|
||||
typedef std::size_t regsize_t;
|
||||
#else
|
||||
typedef ptrdiff_t regoff_t;
|
||||
typedef size_t regsize_t;
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int re_magic;
|
||||
unsigned int re_nsub; /* number of parenthesized subexpressions */
|
||||
const char* re_endp; /* end pointer for REG_PEND */
|
||||
void* guts; /* none of your business :-) */
|
||||
unsigned int eflags; /* none of your business :-) */
|
||||
} regex_tA;
|
||||
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
typedef struct
|
||||
{
|
||||
unsigned int re_magic;
|
||||
unsigned int re_nsub; /* number of parenthesized subexpressions */
|
||||
const wchar_t* re_endp; /* end pointer for REG_PEND */
|
||||
void* guts; /* none of your business :-) */
|
||||
unsigned int eflags; /* none of your business :-) */
|
||||
} regex_tW;
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
regoff_t rm_so; /* start of match */
|
||||
regoff_t rm_eo; /* end of match */
|
||||
} regmatch_t;
|
||||
|
||||
/* regcomp() flags */
|
||||
typedef enum{
|
||||
REG_BASIC = 0000,
|
||||
REG_EXTENDED = 0001,
|
||||
REG_ICASE = 0002,
|
||||
REG_NOSUB = 0004,
|
||||
REG_NEWLINE = 0010,
|
||||
REG_NOSPEC = 0020,
|
||||
REG_PEND = 0040,
|
||||
REG_DUMP = 0200,
|
||||
REG_NOCOLLATE = 0400,
|
||||
REG_ESCAPE_IN_LISTS = 01000,
|
||||
REG_NEWLINE_ALT = 02000,
|
||||
|
||||
REG_PERL = REG_EXTENDED | REG_NOCOLLATE | REG_ESCAPE_IN_LISTS,
|
||||
REG_AWK = REG_EXTENDED | REG_ESCAPE_IN_LISTS,
|
||||
REG_GREP = REG_BASIC | REG_NEWLINE_ALT,
|
||||
REG_EGREP = REG_EXTENDED | REG_NEWLINE_ALT,
|
||||
|
||||
REG_ASSERT = 15,
|
||||
REG_INVARG = 16,
|
||||
REG_ATOI = 255, /* convert name to number (!) */
|
||||
REG_ITOA = 0400 /* convert number to name (!) */
|
||||
} reg_comp_flags;
|
||||
|
||||
/* regexec() flags */
|
||||
typedef enum{
|
||||
REG_NOTBOL = 00001,
|
||||
REG_NOTEOL = 00002,
|
||||
REG_STARTEND = 00004
|
||||
} reg_exec_flags;
|
||||
|
||||
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompA(regex_tA*, const char*, int);
|
||||
BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int, const regex_tA*, char*, regsize_t);
|
||||
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecA(const regex_tA*, const char*, regsize_t, regmatch_t*, int);
|
||||
BOOST_REGEX_DECL void BOOST_REGEX_CCALL regfreeA(regex_tA*);
|
||||
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW*, const wchar_t*, int);
|
||||
BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int, const regex_tW*, wchar_t*, regsize_t);
|
||||
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecW(const regex_tW*, const wchar_t*, regsize_t, regmatch_t*, int);
|
||||
BOOST_REGEX_DECL void BOOST_REGEX_CCALL regfreeW(regex_tW*);
|
||||
#endif
|
||||
|
||||
#ifdef UNICODE
|
||||
#define regcomp regcompW
|
||||
#define regerror regerrorW
|
||||
#define regexec regexecW
|
||||
#define regfree regfreeW
|
||||
#define regex_t regex_tW
|
||||
#else
|
||||
#define regcomp regcompA
|
||||
#define regerror regerrorA
|
||||
#define regexec regexecA
|
||||
#define regfree regfreeA
|
||||
#define regex_t regex_tA
|
||||
#endif
|
||||
|
||||
/* regerror() flags */
|
||||
typedef enum
|
||||
{
|
||||
REG_NOERROR = 0, /* Success. */
|
||||
REG_NOMATCH = 1, /* Didn't find a match (for regexec). */
|
||||
|
||||
/* POSIX regcomp return error codes. (In the order listed in the
|
||||
standard.) */
|
||||
REG_BADPAT = 2, /* Invalid pattern. */
|
||||
REG_ECOLLATE = 3, /* Undefined collating element. */
|
||||
REG_ECTYPE = 4, /* Invalid character class name. */
|
||||
REG_EESCAPE = 5, /* Trailing backslash. */
|
||||
REG_ESUBREG = 6, /* Invalid back reference. */
|
||||
REG_EBRACK = 7, /* Unmatched left bracket. */
|
||||
REG_EPAREN = 8, /* Parenthesis imbalance. */
|
||||
REG_EBRACE = 9, /* Unmatched \{. */
|
||||
REG_BADBR = 10, /* Invalid contents of \{\}. */
|
||||
REG_ERANGE = 11, /* Invalid range end. */
|
||||
REG_ESPACE = 12, /* Ran out of memory. */
|
||||
REG_BADRPT = 13, /* No preceding re for repetition op. */
|
||||
REG_EEND = 14, /* unexpected end of expression */
|
||||
REG_ESIZE = 15, /* expression too big */
|
||||
REG_ERPAREN = 16, /* unmatched right parenthesis */
|
||||
REG_EMPTY = 17, /* empty expression */
|
||||
REG_E_MEMORY = REG_ESIZE, /* out of memory */
|
||||
REG_E_UNKNOWN = 18 /* unknown error */
|
||||
} reg_errcode_t;
|
||||
|
||||
enum match_flags
|
||||
{
|
||||
match_default = 0,
|
||||
match_not_bol = 1, // first is not start of line
|
||||
match_not_eol = match_not_bol << 1, // last is not end of line
|
||||
match_not_bob = match_not_eol << 1, // first is not start of buffer
|
||||
match_not_eob = match_not_bob << 1, // last is not end of buffer
|
||||
match_not_bow = match_not_eob << 1, // first is not start of word
|
||||
match_not_eow = match_not_bow << 1, // last is not end of word
|
||||
match_not_dot_newline = match_not_eow << 1, // \n is not matched by '.'
|
||||
match_not_dot_null = match_not_dot_newline << 1, // '\0' is not matched by '.'
|
||||
match_prev_avail = match_not_dot_null << 1, // *--first is a valid expression
|
||||
match_init = match_prev_avail << 1, // internal use
|
||||
match_any = match_init << 1, // don't care what we match
|
||||
match_not_null = match_any << 1, // string can't be null
|
||||
match_continuous = match_not_null << 1, // each grep match must continue from
|
||||
// uninterupted from the previous one
|
||||
match_partial = match_continuous << 1, // find partial matches
|
||||
|
||||
match_stop = match_partial << 1, // stop after first match (grep)
|
||||
match_all = match_stop << 1, // must find the whole of input even if match_any is set
|
||||
match_max = match_all
|
||||
};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
} // namespace
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#if __BORLANDC__ > 0x520
|
||||
#pragma option pop
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// C++ high level wrapper goes here:
|
||||
//
|
||||
#if defined(__cplusplus)
|
||||
#include <string>
|
||||
#include <vector>
|
||||
namespace boost{
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#if __BORLANDC__ == 0x530
|
||||
#pragma option push -a4 -b
|
||||
#elif __BORLANDC__ > 0x530
|
||||
#pragma option push -a8 -b
|
||||
#endif
|
||||
#endif
|
||||
|
||||
class RegEx;
|
||||
|
||||
namespace re_detail{
|
||||
|
||||
class RegExData;
|
||||
struct pred1;
|
||||
struct pred2;
|
||||
struct pred3;
|
||||
struct pred4;
|
||||
|
||||
} // namespace re_detail
|
||||
|
||||
#if defined(BOOST_MSVC) || defined(__BORLANDC__)
|
||||
typedef bool (__cdecl *GrepCallback)(const RegEx& expression);
|
||||
typedef bool (__cdecl *GrepFileCallback)(const char* file, const RegEx& expression);
|
||||
typedef bool (__cdecl *FindFilesCallback)(const char* file);
|
||||
#else
|
||||
typedef bool (*GrepCallback)(const RegEx& expression);
|
||||
typedef bool (*GrepFileCallback)(const char* file, const RegEx& expression);
|
||||
typedef bool (*FindFilesCallback)(const char* file);
|
||||
#endif
|
||||
|
||||
class BOOST_REGEX_DECL RegEx
|
||||
{
|
||||
private:
|
||||
re_detail::RegExData* pdata;
|
||||
public:
|
||||
RegEx();
|
||||
RegEx(const RegEx& o);
|
||||
~RegEx();
|
||||
explicit RegEx(const char* c, bool icase = false);
|
||||
explicit RegEx(const std::string& s, bool icase = false);
|
||||
RegEx& operator=(const RegEx& o);
|
||||
RegEx& operator=(const char* p);
|
||||
RegEx& operator=(const std::string& s){ return this->operator=(s.c_str()); }
|
||||
unsigned int SetExpression(const char* p, bool icase = false);
|
||||
unsigned int SetExpression(const std::string& s, bool icase = false){ return SetExpression(s.c_str(), icase); }
|
||||
std::string Expression()const;
|
||||
unsigned int error_code()const;
|
||||
//
|
||||
// now matching operators:
|
||||
//
|
||||
bool Match(const char* p, unsigned int flags = match_default);
|
||||
bool Match(const std::string& s, unsigned int flags = match_default) { return Match(s.c_str(), flags); }
|
||||
bool Search(const char* p, unsigned int flags = match_default);
|
||||
bool Search(const std::string& s, unsigned int flags = match_default) { return Search(s.c_str(), flags); }
|
||||
unsigned int Grep(GrepCallback cb, const char* p, unsigned int flags = match_default);
|
||||
unsigned int Grep(GrepCallback cb, const std::string& s, unsigned int flags = match_default) { return Grep(cb, s.c_str(), flags); }
|
||||
unsigned int Grep(std::vector<std::string>& v, const char* p, unsigned int flags = match_default);
|
||||
unsigned int Grep(std::vector<std::string>& v, const std::string& s, unsigned int flags = match_default) { return Grep(v, s.c_str(), flags); }
|
||||
unsigned int Grep(std::vector<std::size_t>& v, const char* p, unsigned int flags = match_default);
|
||||
unsigned int Grep(std::vector<std::size_t>& v, const std::string& s, unsigned int flags = match_default) { return Grep(v, s.c_str(), flags); }
|
||||
#ifndef BOOST_REGEX_NO_FILEITER
|
||||
unsigned int GrepFiles(GrepFileCallback cb, const char* files, bool recurse = false, unsigned int flags = match_default);
|
||||
unsigned int GrepFiles(GrepFileCallback cb, const std::string& files, bool recurse = false, unsigned int flags = match_default) { return GrepFiles(cb, files.c_str(), recurse, flags); }
|
||||
unsigned int FindFiles(FindFilesCallback cb, const char* files, bool recurse = false, unsigned int flags = match_default);
|
||||
unsigned int FindFiles(FindFilesCallback cb, const std::string& files, bool recurse = false, unsigned int flags = match_default) { return FindFiles(cb, files.c_str(), recurse, flags); }
|
||||
#endif
|
||||
|
||||
std::string Merge(const std::string& in, const std::string& fmt,
|
||||
bool copy = true, unsigned int flags = match_default);
|
||||
std::string Merge(const char* in, const char* fmt,
|
||||
bool copy = true, unsigned int flags = match_default);
|
||||
|
||||
std::size_t Split(std::vector<std::string>& v, std::string& s, unsigned flags = match_default, unsigned max_count = ~0);
|
||||
//
|
||||
// now operators for returning what matched in more detail:
|
||||
//
|
||||
std::size_t Position(int i = 0)const;
|
||||
std::size_t Length(int i = 0)const;
|
||||
bool Matched(int i = 0)const;
|
||||
unsigned int Line()const;
|
||||
unsigned int Marks()const;
|
||||
std::string What(int i = 0)const;
|
||||
std::string operator[](int i)const { return What(i); }
|
||||
|
||||
static const unsigned int npos;
|
||||
|
||||
friend struct re_detail::pred1;
|
||||
friend struct re_detail::pred2;
|
||||
friend struct re_detail::pred3;
|
||||
friend struct re_detail::pred4;
|
||||
};
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma option pop
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
#include <boost/regex/v3/cregex.hpp>
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@ -310,3 +34,4 @@ public:
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* LOCATION: see http://www.boost.org/libs/regex for documentation.
|
||||
* FILE regex.h
|
||||
* VERSION 3.12
|
||||
* DESCRIPTION: Declares POSIX API functions
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -125,8 +125,10 @@
|
||||
// If there isn't good enough wide character support then there will
|
||||
// be no wide character regular expressions:
|
||||
//
|
||||
#if (defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_CWCTYPE) || defined(BOOST_NO_STD_WSTRING)) && !defined(BOOST_NO_WREGEX)
|
||||
# define BOOST_NO_WREGEX
|
||||
#if (defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_CWCTYPE) || defined(BOOST_NO_STD_WSTRING))
|
||||
# if !defined(BOOST_NO_WREGEX)
|
||||
# define BOOST_NO_WREGEX
|
||||
# endif
|
||||
#else
|
||||
# if defined(__sgi) && defined(__SGI_STL_PORT)
|
||||
// STLPort on IRIX is misconfigured: <cwctype> does not compile
|
||||
@ -165,7 +167,7 @@
|
||||
|
||||
// We don't make our templates external if the compiler
|
||||
// can't handle it:
|
||||
#if (defined(BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS) || defined(__MWERKS__) || defined(__COMO__) || defined(__ICL) || defined(__ICC))\
|
||||
#if (defined(BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS) || defined(__HP_aCC) || defined(__MWERKS__) || defined(__COMO__) || defined(__ICL) || defined(__ICC))\
|
||||
&& !defined(BOOST_MSVC) && !defined(__BORLANDC__)
|
||||
# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
|
||||
#endif
|
||||
@ -257,7 +259,7 @@ using std::distance;
|
||||
#endif
|
||||
|
||||
#if (defined(BOOST_MSVC) || defined(__BORLANDC__)) && !defined(BOOST_REGEX_NO_LIB) && !defined(BOOST_REGEX_SOURCE)
|
||||
# include <boost/regex/detail/regex_library_include.hpp>
|
||||
# include <boost/regex/v3/regex_library_include.hpp>
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
@ -643,3 +645,6 @@ inline void pointer_construct(T* p, const T& t)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -23,787 +23,12 @@
|
||||
#ifndef BOOST_REGEX_TRAITS_HPP
|
||||
#define BOOST_REGEX_TRAITS_HPP
|
||||
|
||||
#include <boost/cregex.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/regex/detail/regex_cstring.hpp>
|
||||
|
||||
namespace boost{
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma option push -a8 -b -Vx -Ve -pc
|
||||
#ifndef BOOST_REGEX_TRAITS_HPP_INCLUDED
|
||||
#include <boost/regex/v3/regex_traits.hpp>
|
||||
#endif
|
||||
|
||||
template <class charT>
|
||||
class c_regex_traits;
|
||||
|
||||
namespace re_detail{
|
||||
|
||||
struct mss
|
||||
{
|
||||
unsigned int id;
|
||||
const char* what;
|
||||
};
|
||||
|
||||
BOOST_REGEX_DECL bool BOOST_REGEX_CALL re_lookup_def_collate_name(std::string& buf, const char* name);
|
||||
BOOST_REGEX_DECL std::size_t BOOST_REGEX_CALL re_get_default_message(char* buf, std::size_t len, std::size_t id);
|
||||
extern BOOST_REGEX_DECL const char *re_default_error_messages[];
|
||||
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
extern BOOST_REGEX_DECL wchar_t wide_lower_case_map[];
|
||||
extern BOOST_REGEX_DECL unsigned short wide_unicode_classes[];
|
||||
BOOST_REGEX_DECL bool BOOST_REGEX_CALL is_combining(wchar_t c);
|
||||
#endif
|
||||
|
||||
|
||||
struct BOOST_REGEX_DECL regex_traits_base
|
||||
{
|
||||
enum char_syntax_type
|
||||
{
|
||||
syntax_char = 0,
|
||||
syntax_open_bracket = 1, // (
|
||||
syntax_close_bracket = 2, // )
|
||||
syntax_dollar = 3, // $
|
||||
syntax_caret = 4, // ^
|
||||
syntax_dot = 5, // .
|
||||
syntax_star = 6, // *
|
||||
syntax_plus = 7, // +
|
||||
syntax_question = 8, // ?
|
||||
syntax_open_set = 9, // [
|
||||
syntax_close_set = 10, // ]
|
||||
syntax_or = 11, // |
|
||||
syntax_slash = 12, //
|
||||
syntax_hash = 13, // #
|
||||
syntax_dash = 14, // -
|
||||
syntax_open_brace = 15, // {
|
||||
syntax_close_brace = 16, // }
|
||||
syntax_digit = 17, // 0-9
|
||||
syntax_b = 18, // for \b
|
||||
syntax_B = 19, // for \B
|
||||
syntax_left_word = 20, // for \<
|
||||
syntax_right_word = 21, // for \>
|
||||
syntax_w = 22, // for \w
|
||||
syntax_W = 23, // for \W
|
||||
syntax_start_buffer = 24, // for \`
|
||||
syntax_end_buffer = 25, // for \'
|
||||
syntax_newline = 26, // for newline alt
|
||||
syntax_comma = 27, // for {x,y}
|
||||
|
||||
syntax_a = 28, // for \a
|
||||
syntax_f = 29, // for \f
|
||||
syntax_n = 30, // for \n
|
||||
syntax_r = 31, // for \r
|
||||
syntax_t = 32, // for \t
|
||||
syntax_v = 33, // for \v
|
||||
syntax_x = 34, // for \xdd
|
||||
syntax_c = 35, // for \cx
|
||||
syntax_colon = 36, // for [:...:]
|
||||
syntax_equal = 37, // for [=...=]
|
||||
|
||||
// perl ops:
|
||||
syntax_e = 38, // for \e
|
||||
syntax_l = 39, // for \l
|
||||
syntax_L = 40, // for \L
|
||||
syntax_u = 41, // for \u
|
||||
syntax_U = 42, // for \U
|
||||
syntax_s = 43, // for \s
|
||||
syntax_S = 44, // for \S
|
||||
syntax_d = 45, // for \d
|
||||
syntax_D = 46, // for \D
|
||||
syntax_E = 47, // for \Q\E
|
||||
syntax_Q = 48, // for \Q\E
|
||||
syntax_X = 49, // for \X
|
||||
syntax_C = 50, // for \C
|
||||
syntax_Z = 51, // for \Z
|
||||
syntax_G = 52, // for \G
|
||||
|
||||
// new extentions:
|
||||
syntax_not = 53, // for (?!...)
|
||||
|
||||
syntax_max = 54
|
||||
};
|
||||
#ifdef __BORLANDC__
|
||||
private:
|
||||
char dummy_member;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct BOOST_REGEX_DECL c_traits_base : public regex_traits_base
|
||||
{
|
||||
public:
|
||||
enum{
|
||||
char_class_none = 0,
|
||||
char_class_alpha = 0x0001,
|
||||
char_class_cntrl = 0x0002,
|
||||
char_class_digit = 0x0004,
|
||||
char_class_lower = 0x0008,
|
||||
char_class_punct = 0x0010,
|
||||
char_class_space = 0x0020,
|
||||
char_class_upper = 0x0040,
|
||||
char_class_xdigit = 0x0080,
|
||||
char_class_blank = 0x0100,
|
||||
char_class_underscore = 0x4000,
|
||||
char_class_unicode = 0x8000,
|
||||
|
||||
char_class_alnum = char_class_alpha | char_class_digit,
|
||||
char_class_graph = char_class_alpha | char_class_digit | char_class_punct | char_class_underscore,
|
||||
char_class_print = char_class_alpha | char_class_digit | char_class_punct | char_class_underscore | char_class_blank,
|
||||
char_class_word = char_class_alpha | char_class_digit | char_class_underscore
|
||||
};
|
||||
static std::string BOOST_REGEX_CALL set_message_catalogue(const std::string& s);
|
||||
protected:
|
||||
#if defined(__MWERKS__) && __MWERKS__ <= 0x6000
|
||||
friend class c_regex_traits<char>;
|
||||
friend class c_regex_traits<wchar_t>;
|
||||
#endif
|
||||
|
||||
static char regex_message_catalogue[BOOST_REGEX_MAX_PATH];
|
||||
enum syntax_map_size
|
||||
{
|
||||
map_size = UCHAR_MAX + 1
|
||||
};
|
||||
|
||||
static unsigned char syntax_map[map_size];
|
||||
static unsigned short class_map[map_size];
|
||||
static char lower_case_map[map_size];
|
||||
|
||||
static boost::uint_fast32_t BOOST_REGEX_CALL do_lookup_class(const char* p);
|
||||
static bool BOOST_REGEX_CALL do_lookup_collate(std::string& buf, const char* p);
|
||||
static void BOOST_REGEX_CALL do_update_ctype();
|
||||
static void BOOST_REGEX_CALL do_update_collate();
|
||||
public:
|
||||
static std::string BOOST_REGEX_CALL error_string(unsigned id);
|
||||
static char* BOOST_REGEX_CALL get_catalogue() { return regex_message_catalogue; }
|
||||
};
|
||||
|
||||
} // namespace re_detail
|
||||
|
||||
|
||||
template<>
|
||||
class BOOST_REGEX_DECL c_regex_traits<char> : public re_detail::c_traits_base
|
||||
{
|
||||
typedef re_detail::c_traits_base base_type;
|
||||
public:
|
||||
typedef char char_type;
|
||||
typedef unsigned char uchar_type;
|
||||
typedef unsigned int size_type;
|
||||
typedef std::string string_type;
|
||||
typedef int locale_type;
|
||||
|
||||
static std::size_t BOOST_REGEX_CALL length(const char_type* p)
|
||||
{
|
||||
return std::strlen(p);
|
||||
}
|
||||
static unsigned int BOOST_REGEX_CALL syntax_type(size_type c)
|
||||
{
|
||||
return syntax_map[c];
|
||||
}
|
||||
static char BOOST_REGEX_CALL translate(char c, bool icase)
|
||||
{
|
||||
return icase ? lower_case_map[(size_type)(uchar_type)c] : c;
|
||||
}
|
||||
static void BOOST_REGEX_CALL transform(std::string& out, const std::string& in);
|
||||
|
||||
static void BOOST_REGEX_CALL transform_primary(std::string& out, const std::string& in);
|
||||
|
||||
static bool BOOST_REGEX_CALL is_separator(char c)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL((c == '\n') || (c == '\r'));
|
||||
}
|
||||
|
||||
static bool BOOST_REGEX_CALL is_combining(char)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool BOOST_REGEX_CALL is_class(char c, boost::uint_fast32_t f)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL(class_map[(size_type)(uchar_type)c] & f);
|
||||
}
|
||||
|
||||
static int BOOST_REGEX_CALL toi(char c);
|
||||
static int BOOST_REGEX_CALL toi(const char*& first, const char* last, int radix);
|
||||
|
||||
static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const char* first, const char* last)
|
||||
{
|
||||
std::string s(first, last);
|
||||
return do_lookup_class(s.c_str());
|
||||
}
|
||||
|
||||
static bool BOOST_REGEX_CALL lookup_collatename(std::string& buf, const char* first, const char* last)
|
||||
{
|
||||
std::string s(first, last);
|
||||
return do_lookup_collate(buf, s.c_str());
|
||||
}
|
||||
|
||||
static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
|
||||
locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
|
||||
|
||||
c_regex_traits()
|
||||
{
|
||||
init();
|
||||
}
|
||||
~c_regex_traits()
|
||||
{
|
||||
m_free();
|
||||
}
|
||||
struct sentry
|
||||
{
|
||||
sentry(const c_regex_traits<char>&)
|
||||
{ c_regex_traits<char>::update(); }
|
||||
operator void*() { return this; }
|
||||
};
|
||||
static void BOOST_REGEX_CALL update();
|
||||
private:
|
||||
static void BOOST_REGEX_CALL init();
|
||||
static void BOOST_REGEX_CALL m_free();
|
||||
static c_regex_traits<char> i;
|
||||
|
||||
static unsigned sort_type;
|
||||
static char sort_delim;
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
template<>
|
||||
class BOOST_REGEX_DECL c_regex_traits<wchar_t> : public re_detail::c_traits_base
|
||||
{
|
||||
typedef re_detail::c_traits_base base_type;
|
||||
public:
|
||||
typedef wchar_t char_type;
|
||||
typedef unsigned short uchar_type;
|
||||
typedef unsigned int size_type;
|
||||
typedef std::basic_string<wchar_t> string_type;
|
||||
typedef int locale_type;
|
||||
static std::size_t BOOST_REGEX_CALL length(const char_type* p)
|
||||
{
|
||||
return std::wcslen(p);
|
||||
}
|
||||
static unsigned int BOOST_REGEX_CALL syntax_type(size_type c);
|
||||
static wchar_t BOOST_REGEX_CALL translate(wchar_t c, bool icase)
|
||||
{
|
||||
return icase ? ((c < 256) ? re_detail::wide_lower_case_map[(uchar_type)c] : std::towlower(c)) : c;
|
||||
}
|
||||
|
||||
static void BOOST_REGEX_CALL transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
|
||||
|
||||
static void BOOST_REGEX_CALL transform_primary(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
|
||||
|
||||
static bool BOOST_REGEX_CALL is_separator(wchar_t c)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029));
|
||||
}
|
||||
|
||||
static bool BOOST_REGEX_CALL is_combining(wchar_t c)
|
||||
{ return re_detail::is_combining(c); }
|
||||
|
||||
static bool BOOST_REGEX_CALL is_class(wchar_t c, boost::uint_fast32_t f)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL(((uchar_type)c < 256) ? (re_detail::wide_unicode_classes[(size_type)(uchar_type)c] & f) : do_iswclass(c, f));
|
||||
}
|
||||
|
||||
static int BOOST_REGEX_CALL toi(wchar_t c);
|
||||
static int BOOST_REGEX_CALL toi(const wchar_t*& first, const wchar_t* last, int radix);
|
||||
|
||||
static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last);
|
||||
|
||||
static bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<wchar_t>& s, const wchar_t* first, const wchar_t* last);
|
||||
|
||||
static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
|
||||
locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
|
||||
c_regex_traits<wchar_t>()
|
||||
{ init(); }
|
||||
~c_regex_traits<wchar_t>()
|
||||
{ m_free(); }
|
||||
struct sentry
|
||||
{
|
||||
sentry(const c_regex_traits<wchar_t>&)
|
||||
{ c_regex_traits<wchar_t>::update(); }
|
||||
operator void*() { return this; }
|
||||
};
|
||||
static void BOOST_REGEX_CALL update();
|
||||
static std::size_t BOOST_REGEX_CALL strnarrow(char *s1, std::size_t len, const wchar_t *s2);
|
||||
static std::size_t BOOST_REGEX_CALL strwiden(wchar_t *s1, std::size_t 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 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_;
|
||||
|
||||
static unsigned sort_type;
|
||||
static wchar_t sort_delim;
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
|
||||
|
||||
namespace re_detail{
|
||||
|
||||
struct BOOST_REGEX_DECL w32_traits_base : public regex_traits_base
|
||||
{
|
||||
enum{
|
||||
char_class_none = 0,
|
||||
char_class_alnum = C1_ALPHA | C1_DIGIT,
|
||||
char_class_alpha = C1_ALPHA,
|
||||
char_class_cntrl = C1_CNTRL,
|
||||
char_class_digit = C1_DIGIT,
|
||||
char_class_graph = C1_UPPER | C1_LOWER | C1_DIGIT | C1_PUNCT | C1_ALPHA,
|
||||
char_class_lower = C1_LOWER,
|
||||
char_class_print = C1_UPPER | C1_LOWER | C1_DIGIT | C1_PUNCT | C1_BLANK | C1_ALPHA,
|
||||
char_class_punct = C1_PUNCT,
|
||||
char_class_space = C1_SPACE,
|
||||
char_class_upper = C1_UPPER,
|
||||
char_class_xdigit = C1_XDIGIT,
|
||||
char_class_blank = C1_BLANK,
|
||||
char_class_underscore = 0x4000,
|
||||
char_class_word = C1_ALPHA | C1_DIGIT | char_class_underscore,
|
||||
char_class_unicode = 0x8000,
|
||||
char_class_win = 0x01FF
|
||||
};
|
||||
|
||||
|
||||
public:
|
||||
static std::string BOOST_REGEX_CALL set_message_catalogue(const std::string& s);
|
||||
protected:
|
||||
static char regex_message_catalogue[BOOST_REGEX_MAX_PATH];
|
||||
enum syntax_map_size
|
||||
{
|
||||
map_size = UCHAR_MAX + 1
|
||||
};
|
||||
|
||||
static unsigned char syntax_map[map_size];
|
||||
static unsigned short class_map[map_size];
|
||||
static char lower_case_map[map_size];
|
||||
|
||||
static boost::uint_fast32_t BOOST_REGEX_CALL do_lookup_class(const char* p);
|
||||
static bool BOOST_REGEX_CALL do_lookup_collate(std::string& buf, const char* p);
|
||||
static void BOOST_REGEX_CALL do_free();
|
||||
static void BOOST_REGEX_CALL do_init();
|
||||
public:
|
||||
static std::string BOOST_REGEX_CALL error_string(unsigned id);
|
||||
static char* BOOST_REGEX_CALL get_catalogue() { return regex_message_catalogue; }
|
||||
};
|
||||
|
||||
|
||||
} // namespace re_detail
|
||||
|
||||
template<class charT>
|
||||
class w32_regex_traits;
|
||||
|
||||
template<>
|
||||
class BOOST_REGEX_DECL w32_regex_traits<char> : public re_detail::w32_traits_base
|
||||
{
|
||||
typedef re_detail::w32_traits_base base_type;
|
||||
public:
|
||||
typedef char char_type;
|
||||
typedef unsigned char uchar_type;
|
||||
typedef unsigned int size_type;
|
||||
typedef std::string string_type;
|
||||
typedef int locale_type;
|
||||
|
||||
static std::size_t BOOST_REGEX_CALL length(const char_type* p)
|
||||
{
|
||||
return std::strlen(p);
|
||||
}
|
||||
static unsigned int BOOST_REGEX_CALL syntax_type(size_type c)
|
||||
{
|
||||
return syntax_map[c];
|
||||
}
|
||||
static char BOOST_REGEX_CALL translate(char c, bool icase)
|
||||
{
|
||||
return icase ? lower_case_map[(size_type)(uchar_type)c] : c;
|
||||
}
|
||||
static void BOOST_REGEX_CALL transform(std::string& out, const std::string& in);
|
||||
|
||||
static void BOOST_REGEX_CALL transform_primary(std::string& out, const std::string& in);
|
||||
|
||||
static bool BOOST_REGEX_CALL is_separator(char c)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL((c == '\n') || (c == '\r'));
|
||||
}
|
||||
|
||||
static bool BOOST_REGEX_CALL is_combining(char)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool BOOST_REGEX_CALL is_class(char c, boost::uint_fast32_t f)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL(class_map[(size_type)(uchar_type)c] & f);
|
||||
}
|
||||
|
||||
static int BOOST_REGEX_CALL toi(char c);
|
||||
static int BOOST_REGEX_CALL toi(const char*& first, const char* last, int radix);
|
||||
|
||||
static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const char* first, const char* last)
|
||||
{
|
||||
std::string s(first, last);
|
||||
return do_lookup_class(s.c_str());
|
||||
}
|
||||
|
||||
static bool BOOST_REGEX_CALL lookup_collatename(std::string& buf, const char* first, const char* last)
|
||||
{
|
||||
std::string s(first, last);
|
||||
return do_lookup_collate(buf, s.c_str());
|
||||
}
|
||||
|
||||
static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
|
||||
locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
|
||||
|
||||
struct sentry
|
||||
{
|
||||
sentry(const w32_regex_traits<char>&)
|
||||
{ w32_regex_traits<char>::update(); }
|
||||
~sentry(){}
|
||||
operator void*() { return this; }
|
||||
};
|
||||
static void BOOST_REGEX_CALL update();
|
||||
w32_regex_traits();
|
||||
~w32_regex_traits();
|
||||
private:
|
||||
static w32_regex_traits<char> i;
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
template<>
|
||||
class BOOST_REGEX_DECL w32_regex_traits<wchar_t> : public re_detail::w32_traits_base
|
||||
{
|
||||
typedef re_detail::w32_traits_base base_type;
|
||||
public:
|
||||
typedef wchar_t char_type;
|
||||
typedef unsigned short uchar_type;
|
||||
typedef unsigned int size_type;
|
||||
typedef std::basic_string<wchar_t> string_type;
|
||||
typedef int locale_type;
|
||||
static std::size_t BOOST_REGEX_CALL length(const char_type* p)
|
||||
{
|
||||
return std::wcslen(p);
|
||||
}
|
||||
static unsigned int BOOST_REGEX_CALL syntax_type(size_type c);
|
||||
static wchar_t BOOST_REGEX_CALL translate(wchar_t c, bool icase)
|
||||
{
|
||||
return icase ? ((c < 256) ? re_detail::wide_lower_case_map[(uchar_type)c] : wtolower(c)) : c;
|
||||
}
|
||||
|
||||
static void BOOST_REGEX_CALL transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
|
||||
|
||||
static void BOOST_REGEX_CALL transform_primary(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
|
||||
|
||||
static bool BOOST_REGEX_CALL is_separator(wchar_t c)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029));
|
||||
}
|
||||
|
||||
static bool BOOST_REGEX_CALL is_combining(wchar_t c)
|
||||
{ return re_detail::is_combining(c); }
|
||||
|
||||
static bool BOOST_REGEX_CALL is_class(wchar_t c, boost::uint_fast32_t f)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL(((uchar_type)c < 256) ? (wide_unicode_classes[(size_type)(uchar_type)c] & f) : do_iswclass(c, f));
|
||||
}
|
||||
|
||||
static int BOOST_REGEX_CALL toi(wchar_t c);
|
||||
static int BOOST_REGEX_CALL toi(const wchar_t*& first, const wchar_t* last, int radix);
|
||||
|
||||
static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last);
|
||||
|
||||
static bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<wchar_t>& s, const wchar_t* first, const wchar_t* last);
|
||||
|
||||
static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
|
||||
locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
|
||||
|
||||
struct sentry
|
||||
{
|
||||
sentry(const w32_regex_traits<wchar_t>&)
|
||||
{ w32_regex_traits<wchar_t>::update(); }
|
||||
~sentry(){}
|
||||
operator void*() { return this; }
|
||||
};
|
||||
static void BOOST_REGEX_CALL update();
|
||||
w32_regex_traits();
|
||||
~w32_regex_traits();
|
||||
static std::size_t BOOST_REGEX_CALL strnarrow(char *s1, std::size_t len, const wchar_t *s2);
|
||||
static std::size_t BOOST_REGEX_CALL strwiden(wchar_t *s1, std::size_t len, const char *s2);
|
||||
|
||||
private:
|
||||
static bool BOOST_REGEX_CALL do_iswclass(wchar_t c, boost::uint_fast32_t f);
|
||||
static bool BOOST_REGEX_CALL do_lookup_collate(std::basic_string<wchar_t>& out, const wchar_t* first, const wchar_t* last);
|
||||
static w32_regex_traits<wchar_t> init_;
|
||||
static wchar_t BOOST_REGEX_CALL wtolower(wchar_t c);
|
||||
static unsigned short wide_unicode_classes[];
|
||||
};
|
||||
#endif // Wide strings
|
||||
#endif // Win32
|
||||
|
||||
#if !defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_WSTREAMBUF)
|
||||
|
||||
} // namspace boost
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma option pop
|
||||
#endif
|
||||
#include <locale>
|
||||
#ifdef __BORLANDC__
|
||||
#pragma option push -a4 -b -Ve -pc
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
|
||||
namespace re_detail
|
||||
{
|
||||
|
||||
template <class charT>
|
||||
struct message_data;
|
||||
|
||||
template <>
|
||||
struct message_data<char>;
|
||||
|
||||
template <>
|
||||
struct message_data<wchar_t>;
|
||||
|
||||
struct BOOST_REGEX_DECL cpp_regex_traits_base : public regex_traits_base
|
||||
{
|
||||
enum char_class_type
|
||||
{
|
||||
char_class_none = 0,
|
||||
char_class_alnum = std::ctype_base::alnum,
|
||||
char_class_alpha = std::ctype_base::alpha,
|
||||
char_class_cntrl = std::ctype_base::cntrl,
|
||||
char_class_digit = std::ctype_base::digit,
|
||||
char_class_graph = std::ctype_base::graph,
|
||||
char_class_lower = std::ctype_base::lower,
|
||||
char_class_print = std::ctype_base::print,
|
||||
char_class_punct = std::ctype_base::punct,
|
||||
char_class_space = std::ctype_base::space,
|
||||
char_class_upper = std::ctype_base::upper,
|
||||
char_class_xdigit = std::ctype_base::xdigit,
|
||||
char_class_blank = 1<<12,
|
||||
char_class_underscore = 1<<13,
|
||||
char_class_word = std::ctype_base::alnum | char_class_underscore,
|
||||
char_class_unicode = 1<<14,
|
||||
char_class_all_base = char_class_alnum | char_class_alpha | char_class_cntrl
|
||||
| char_class_digit | char_class_graph | char_class_lower
|
||||
| char_class_print | char_class_punct | char_class_space
|
||||
| char_class_upper | char_class_xdigit
|
||||
};
|
||||
|
||||
static std::string BOOST_REGEX_CALL set_message_catalogue(const std::string& s);
|
||||
protected:
|
||||
static char regex_message_cat[BOOST_REGEX_MAX_PATH];
|
||||
};
|
||||
|
||||
} // namespace re_detail
|
||||
|
||||
template <class charT>
|
||||
class cpp_regex_traits;
|
||||
|
||||
template<>
|
||||
class BOOST_REGEX_DECL cpp_regex_traits<char> : public re_detail::cpp_regex_traits_base
|
||||
{
|
||||
typedef re_detail::cpp_regex_traits_base base_type;
|
||||
private:
|
||||
re_detail::message_data<char>* pmd;
|
||||
const unsigned char* psyntax;
|
||||
char* lower_map;
|
||||
const std::ctype<char>* pctype;
|
||||
const std::collate<char>* pcollate;
|
||||
std::locale locale_inst;
|
||||
unsigned sort_type;
|
||||
char sort_delim;
|
||||
|
||||
cpp_regex_traits(const cpp_regex_traits&);
|
||||
cpp_regex_traits& operator=(const cpp_regex_traits&);
|
||||
|
||||
public:
|
||||
typedef char char_type;
|
||||
typedef unsigned char uchar_type;
|
||||
typedef unsigned int size_type;
|
||||
typedef std::string string_type;
|
||||
typedef std::locale locale_type;
|
||||
|
||||
cpp_regex_traits();
|
||||
~cpp_regex_traits();
|
||||
|
||||
static std::size_t BOOST_REGEX_CALL length(const char_type* p)
|
||||
{
|
||||
return std::strlen(p);
|
||||
}
|
||||
unsigned int BOOST_REGEX_CALL syntax_type(size_type c)const
|
||||
{
|
||||
return psyntax[c];
|
||||
}
|
||||
char BOOST_REGEX_CALL translate(char c, bool icase)const
|
||||
{
|
||||
return icase ? lower_map[(size_type)(uchar_type)c] : c;
|
||||
}
|
||||
void BOOST_REGEX_CALL transform(std::string& out, const std::string& in)const
|
||||
{
|
||||
out = pcollate->transform(in.c_str(), in.c_str() + in.size()).c_str();
|
||||
}
|
||||
|
||||
void BOOST_REGEX_CALL transform_primary(std::string& out, const std::string& in)const;
|
||||
|
||||
static bool BOOST_REGEX_CALL is_separator(char c)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL((c == '\n') || (c == '\r'));
|
||||
}
|
||||
|
||||
static bool BOOST_REGEX_CALL is_combining(char)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BOOST_REGEX_CALL is_class(char c, boost::uint_fast32_t f)const
|
||||
{
|
||||
if(pctype->is((std::ctype<char>::mask)(f & char_class_all_base), c))
|
||||
return true;
|
||||
if((f & char_class_underscore) && (c == '_'))
|
||||
return true;
|
||||
if((f & char_class_blank) && ((c == ' ') || (c == '\t')))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
int BOOST_REGEX_CALL toi(char c)const;
|
||||
int BOOST_REGEX_CALL toi(const char*& first, const char* last, int radix)const;
|
||||
|
||||
boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const char* first, const char* last)const;
|
||||
bool BOOST_REGEX_CALL lookup_collatename(std::string& s, const char* first, const char* last)const;
|
||||
|
||||
std::string BOOST_REGEX_CALL error_string(unsigned id)const;
|
||||
locale_type BOOST_REGEX_CALL imbue(locale_type l);
|
||||
locale_type BOOST_REGEX_CALL getloc()const{ return locale_inst; }
|
||||
|
||||
struct sentry
|
||||
{
|
||||
sentry(const cpp_regex_traits<char>&){}
|
||||
operator void*() { return this; }
|
||||
};
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
template<>
|
||||
class BOOST_REGEX_DECL cpp_regex_traits<wchar_t> : public re_detail::cpp_regex_traits_base
|
||||
{
|
||||
typedef re_detail::cpp_regex_traits_base base_type;
|
||||
public:
|
||||
typedef wchar_t char_type;
|
||||
typedef unsigned short uchar_type;
|
||||
typedef unsigned int size_type;
|
||||
typedef std::basic_string<wchar_t> string_type;
|
||||
typedef std::locale locale_type;
|
||||
|
||||
private:
|
||||
re_detail::message_data<wchar_t>* pmd;
|
||||
const unsigned char* psyntax;
|
||||
wchar_t* lower_map;
|
||||
const std::ctype<wchar_t>* pctype;
|
||||
const std::collate<wchar_t>* pcollate;
|
||||
const std::codecvt<wchar_t, char, std::mbstate_t>* pcdv;
|
||||
std::locale locale_inst;
|
||||
unsigned int BOOST_REGEX_CALL do_syntax_type(size_type c)const;
|
||||
unsigned sort_type;
|
||||
wchar_t sort_delim;
|
||||
|
||||
cpp_regex_traits(const cpp_regex_traits&);
|
||||
cpp_regex_traits& operator=(const cpp_regex_traits&);
|
||||
|
||||
public:
|
||||
|
||||
static std::size_t BOOST_REGEX_CALL length(const char_type* p)
|
||||
{
|
||||
return std::wcslen(p);
|
||||
}
|
||||
unsigned int BOOST_REGEX_CALL syntax_type(size_type c)const
|
||||
{
|
||||
return (c < UCHAR_MAX) ? psyntax[c] : do_syntax_type(c);
|
||||
}
|
||||
wchar_t BOOST_REGEX_CALL translate(wchar_t c, bool icase)const
|
||||
{
|
||||
return icase ? (((uchar_type)c) <= UCHAR_MAX) ? lower_map[c] : pctype->tolower(c) : c;
|
||||
}
|
||||
void BOOST_REGEX_CALL transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in)const
|
||||
{
|
||||
out = pcollate->transform(in.c_str(), in.c_str() + in.size());
|
||||
}
|
||||
|
||||
void BOOST_REGEX_CALL transform_primary(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in)const;
|
||||
|
||||
static bool BOOST_REGEX_CALL is_separator(wchar_t c)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029));
|
||||
}
|
||||
|
||||
static bool BOOST_REGEX_CALL is_combining(wchar_t c)
|
||||
{ return re_detail::is_combining(c); }
|
||||
|
||||
bool BOOST_REGEX_CALL is_class(wchar_t c, boost::uint_fast32_t f)const
|
||||
{
|
||||
if(pctype->is((std::ctype<wchar_t>::mask)(f & char_class_all_base), c))
|
||||
return true;
|
||||
if((f & char_class_underscore) && (c == '_'))
|
||||
return true;
|
||||
if((f & char_class_blank) && ((c == ' ') || (c == '\t')))
|
||||
return true;
|
||||
if((f & char_class_unicode) && ((uchar_type)c > (uchar_type)255))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
int BOOST_REGEX_CALL toi(wchar_t c)const;
|
||||
int BOOST_REGEX_CALL toi(const wchar_t*& first, const wchar_t* last, int radix)const;
|
||||
|
||||
boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last)const;
|
||||
bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<wchar_t>& s, const wchar_t* first, const wchar_t* last)const;
|
||||
|
||||
std::string BOOST_REGEX_CALL error_string(unsigned id)const;
|
||||
cpp_regex_traits();
|
||||
~cpp_regex_traits();
|
||||
locale_type BOOST_REGEX_CALL imbue(locale_type l);
|
||||
locale_type BOOST_REGEX_CALL getloc()const{ return locale_inst; }
|
||||
std::size_t BOOST_REGEX_CALL strwiden(wchar_t *s1, std::size_t len, const char *s2)const;
|
||||
|
||||
struct sentry
|
||||
{
|
||||
sentry(const cpp_regex_traits<wchar_t>&){}
|
||||
operator void*() { return this; }
|
||||
};
|
||||
};
|
||||
#endif // BOOST_NO_WREGEX
|
||||
|
||||
#endif // BOOST_NO_STD_LOCALE
|
||||
|
||||
#ifdef BOOST_REGEX_USE_WIN32_LOCALE
|
||||
|
||||
template <class charT>
|
||||
class regex_traits : public w32_regex_traits<charT>
|
||||
{
|
||||
};
|
||||
|
||||
#elif defined(BOOST_REGEX_USE_C_LOCALE)
|
||||
|
||||
template <class charT>
|
||||
class regex_traits : public c_regex_traits<charT>
|
||||
{
|
||||
};
|
||||
|
||||
#elif defined(BOOST_REGEX_USE_CPP_LOCALE)
|
||||
|
||||
template <class charT>
|
||||
class regex_traits : public cpp_regex_traits<charT>
|
||||
{
|
||||
};
|
||||
|
||||
#else
|
||||
#error No default localisation model defined
|
||||
#endif
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma option pop
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // include
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -19,15 +19,23 @@
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Includes all the regex source files, include this
|
||||
* file only if you need to build the regex library
|
||||
* as a single file. Before including this file you
|
||||
* must define BOOST_REGEX_NO_LIB, or include this file
|
||||
* as a single file. You must include this file
|
||||
* before any other regex header.
|
||||
*
|
||||
* CAUTION: THIS FILE IS DEPRICATED AND WILL CAUSE
|
||||
* UNNECESSARY CODE BLOAT.
|
||||
*/
|
||||
|
||||
#if !defined(BOOST_REGEX_NO_LIB) && defined(BOOST_REGEX_CONFIG_HPP)
|
||||
#error too late you have already included a regex header - try defining BOOST_REGEX_NO_LIB when you build
|
||||
#if (!defined(BOOST_REGEX_NO_LIB) || !defined(BOOST_REGEX_NO_EXTERNAL_TEMPLATES)) && defined(BOOST_REGEX_CONFIG_HPP)
|
||||
#error too late you have already included a regex header - make sure that you include this header before any other boost header
|
||||
#endif
|
||||
|
||||
#define BOOST_REGEX_NO_LIB
|
||||
#define BOOST_REGEX_STATIC_LINK
|
||||
#define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
|
||||
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
//
|
||||
// include library source files:
|
||||
//
|
||||
@ -47,3 +55,4 @@
|
||||
#include "libs/regex/src/regex_debug.cpp"
|
||||
#include "libs/regex/src/regex_synch.cpp"
|
||||
|
||||
|
||||
|
316
include/boost/regex/v3/cregex.hpp
Normal file
316
include/boost/regex/v3/cregex.hpp
Normal file
@ -0,0 +1,316 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1998-2002
|
||||
* Dr John Maddock
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Dr John Maddock makes no representations
|
||||
* about the suitability of this software for any purpose.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE cregex.cpp
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Declares POSIX API functions
|
||||
* + boost::RegEx high level wrapper.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_RE_CREGEX_HPP_INCLUDED
|
||||
#define BOOST_RE_CREGEX_HPP_INCLUDED
|
||||
|
||||
#ifndef BOOST_REGEX_CONFIG_HPP
|
||||
#include <boost/regex/config.hpp>
|
||||
#endif
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma option push -a8 -b -Vx -Ve -pc
|
||||
#endif
|
||||
|
||||
/* include these defs only for POSIX compatablity */
|
||||
#ifdef __cplusplus
|
||||
namespace boost{
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && !defined(BOOST_NO_STDC_NAMESPACE)
|
||||
typedef std::ptrdiff_t regoff_t;
|
||||
typedef std::size_t regsize_t;
|
||||
#else
|
||||
typedef ptrdiff_t regoff_t;
|
||||
typedef size_t regsize_t;
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int re_magic;
|
||||
unsigned int re_nsub; /* number of parenthesized subexpressions */
|
||||
const char* re_endp; /* end pointer for REG_PEND */
|
||||
void* guts; /* none of your business :-) */
|
||||
unsigned int eflags; /* none of your business :-) */
|
||||
} regex_tA;
|
||||
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
typedef struct
|
||||
{
|
||||
unsigned int re_magic;
|
||||
unsigned int re_nsub; /* number of parenthesized subexpressions */
|
||||
const wchar_t* re_endp; /* end pointer for REG_PEND */
|
||||
void* guts; /* none of your business :-) */
|
||||
unsigned int eflags; /* none of your business :-) */
|
||||
} regex_tW;
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
regoff_t rm_so; /* start of match */
|
||||
regoff_t rm_eo; /* end of match */
|
||||
} regmatch_t;
|
||||
|
||||
/* regcomp() flags */
|
||||
typedef enum{
|
||||
REG_BASIC = 0000,
|
||||
REG_EXTENDED = 0001,
|
||||
REG_ICASE = 0002,
|
||||
REG_NOSUB = 0004,
|
||||
REG_NEWLINE = 0010,
|
||||
REG_NOSPEC = 0020,
|
||||
REG_PEND = 0040,
|
||||
REG_DUMP = 0200,
|
||||
REG_NOCOLLATE = 0400,
|
||||
REG_ESCAPE_IN_LISTS = 01000,
|
||||
REG_NEWLINE_ALT = 02000,
|
||||
|
||||
REG_PERL = REG_EXTENDED | REG_NOCOLLATE | REG_ESCAPE_IN_LISTS,
|
||||
REG_AWK = REG_EXTENDED | REG_ESCAPE_IN_LISTS,
|
||||
REG_GREP = REG_BASIC | REG_NEWLINE_ALT,
|
||||
REG_EGREP = REG_EXTENDED | REG_NEWLINE_ALT,
|
||||
|
||||
REG_ASSERT = 15,
|
||||
REG_INVARG = 16,
|
||||
REG_ATOI = 255, /* convert name to number (!) */
|
||||
REG_ITOA = 0400 /* convert number to name (!) */
|
||||
} reg_comp_flags;
|
||||
|
||||
/* regexec() flags */
|
||||
typedef enum{
|
||||
REG_NOTBOL = 00001,
|
||||
REG_NOTEOL = 00002,
|
||||
REG_STARTEND = 00004
|
||||
} reg_exec_flags;
|
||||
|
||||
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompA(regex_tA*, const char*, int);
|
||||
BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int, const regex_tA*, char*, regsize_t);
|
||||
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecA(const regex_tA*, const char*, regsize_t, regmatch_t*, int);
|
||||
BOOST_REGEX_DECL void BOOST_REGEX_CCALL regfreeA(regex_tA*);
|
||||
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW*, const wchar_t*, int);
|
||||
BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int, const regex_tW*, wchar_t*, regsize_t);
|
||||
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecW(const regex_tW*, const wchar_t*, regsize_t, regmatch_t*, int);
|
||||
BOOST_REGEX_DECL void BOOST_REGEX_CCALL regfreeW(regex_tW*);
|
||||
#endif
|
||||
|
||||
#ifdef UNICODE
|
||||
#define regcomp regcompW
|
||||
#define regerror regerrorW
|
||||
#define regexec regexecW
|
||||
#define regfree regfreeW
|
||||
#define regex_t regex_tW
|
||||
#else
|
||||
#define regcomp regcompA
|
||||
#define regerror regerrorA
|
||||
#define regexec regexecA
|
||||
#define regfree regfreeA
|
||||
#define regex_t regex_tA
|
||||
#endif
|
||||
|
||||
/* regerror() flags */
|
||||
typedef enum
|
||||
{
|
||||
REG_NOERROR = 0, /* Success. */
|
||||
REG_NOMATCH = 1, /* Didn't find a match (for regexec). */
|
||||
|
||||
/* POSIX regcomp return error codes. (In the order listed in the
|
||||
standard.) */
|
||||
REG_BADPAT = 2, /* Invalid pattern. */
|
||||
REG_ECOLLATE = 3, /* Undefined collating element. */
|
||||
REG_ECTYPE = 4, /* Invalid character class name. */
|
||||
REG_EESCAPE = 5, /* Trailing backslash. */
|
||||
REG_ESUBREG = 6, /* Invalid back reference. */
|
||||
REG_EBRACK = 7, /* Unmatched left bracket. */
|
||||
REG_EPAREN = 8, /* Parenthesis imbalance. */
|
||||
REG_EBRACE = 9, /* Unmatched \{. */
|
||||
REG_BADBR = 10, /* Invalid contents of \{\}. */
|
||||
REG_ERANGE = 11, /* Invalid range end. */
|
||||
REG_ESPACE = 12, /* Ran out of memory. */
|
||||
REG_BADRPT = 13, /* No preceding re for repetition op. */
|
||||
REG_EEND = 14, /* unexpected end of expression */
|
||||
REG_ESIZE = 15, /* expression too big */
|
||||
REG_ERPAREN = 16, /* unmatched right parenthesis */
|
||||
REG_EMPTY = 17, /* empty expression */
|
||||
REG_E_MEMORY = REG_ESIZE, /* out of memory */
|
||||
REG_E_UNKNOWN = 18 /* unknown error */
|
||||
} reg_errcode_t;
|
||||
|
||||
enum match_flags
|
||||
{
|
||||
match_default = 0,
|
||||
match_not_bol = 1, // first is not start of line
|
||||
match_not_eol = match_not_bol << 1, // last is not end of line
|
||||
match_not_bob = match_not_eol << 1, // first is not start of buffer
|
||||
match_not_eob = match_not_bob << 1, // last is not end of buffer
|
||||
match_not_bow = match_not_eob << 1, // first is not start of word
|
||||
match_not_eow = match_not_bow << 1, // last is not end of word
|
||||
match_not_dot_newline = match_not_eow << 1, // \n is not matched by '.'
|
||||
match_not_dot_null = match_not_dot_newline << 1, // '\0' is not matched by '.'
|
||||
match_prev_avail = match_not_dot_null << 1, // *--first is a valid expression
|
||||
match_init = match_prev_avail << 1, // internal use
|
||||
match_any = match_init << 1, // don't care what we match
|
||||
match_not_null = match_any << 1, // string can't be null
|
||||
match_continuous = match_not_null << 1, // each grep match must continue from
|
||||
// uninterupted from the previous one
|
||||
match_partial = match_continuous << 1, // find partial matches
|
||||
|
||||
match_stop = match_partial << 1, // stop after first match (grep)
|
||||
match_all = match_stop << 1, // must find the whole of input even if match_any is set
|
||||
match_max = match_all
|
||||
};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
} // namespace
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#if __BORLANDC__ > 0x520
|
||||
#pragma option pop
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// C++ high level wrapper goes here:
|
||||
//
|
||||
#if defined(__cplusplus)
|
||||
#include <string>
|
||||
#include <vector>
|
||||
namespace boost{
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#if __BORLANDC__ == 0x530
|
||||
#pragma option push -a4 -b
|
||||
#elif __BORLANDC__ > 0x530
|
||||
#pragma option push -a8 -b
|
||||
#endif
|
||||
#endif
|
||||
|
||||
class RegEx;
|
||||
|
||||
namespace re_detail{
|
||||
|
||||
class RegExData;
|
||||
struct pred1;
|
||||
struct pred2;
|
||||
struct pred3;
|
||||
struct pred4;
|
||||
|
||||
} // namespace re_detail
|
||||
|
||||
#if defined(BOOST_MSVC) || defined(__BORLANDC__)
|
||||
typedef bool (__cdecl *GrepCallback)(const RegEx& expression);
|
||||
typedef bool (__cdecl *GrepFileCallback)(const char* file, const RegEx& expression);
|
||||
typedef bool (__cdecl *FindFilesCallback)(const char* file);
|
||||
#else
|
||||
typedef bool (*GrepCallback)(const RegEx& expression);
|
||||
typedef bool (*GrepFileCallback)(const char* file, const RegEx& expression);
|
||||
typedef bool (*FindFilesCallback)(const char* file);
|
||||
#endif
|
||||
|
||||
class BOOST_REGEX_DECL RegEx
|
||||
{
|
||||
private:
|
||||
re_detail::RegExData* pdata;
|
||||
public:
|
||||
RegEx();
|
||||
RegEx(const RegEx& o);
|
||||
~RegEx();
|
||||
explicit RegEx(const char* c, bool icase = false);
|
||||
explicit RegEx(const std::string& s, bool icase = false);
|
||||
RegEx& operator=(const RegEx& o);
|
||||
RegEx& operator=(const char* p);
|
||||
RegEx& operator=(const std::string& s){ return this->operator=(s.c_str()); }
|
||||
unsigned int SetExpression(const char* p, bool icase = false);
|
||||
unsigned int SetExpression(const std::string& s, bool icase = false){ return SetExpression(s.c_str(), icase); }
|
||||
std::string Expression()const;
|
||||
unsigned int error_code()const;
|
||||
//
|
||||
// now matching operators:
|
||||
//
|
||||
bool Match(const char* p, unsigned int flags = match_default);
|
||||
bool Match(const std::string& s, unsigned int flags = match_default) { return Match(s.c_str(), flags); }
|
||||
bool Search(const char* p, unsigned int flags = match_default);
|
||||
bool Search(const std::string& s, unsigned int flags = match_default) { return Search(s.c_str(), flags); }
|
||||
unsigned int Grep(GrepCallback cb, const char* p, unsigned int flags = match_default);
|
||||
unsigned int Grep(GrepCallback cb, const std::string& s, unsigned int flags = match_default) { return Grep(cb, s.c_str(), flags); }
|
||||
unsigned int Grep(std::vector<std::string>& v, const char* p, unsigned int flags = match_default);
|
||||
unsigned int Grep(std::vector<std::string>& v, const std::string& s, unsigned int flags = match_default) { return Grep(v, s.c_str(), flags); }
|
||||
unsigned int Grep(std::vector<std::size_t>& v, const char* p, unsigned int flags = match_default);
|
||||
unsigned int Grep(std::vector<std::size_t>& v, const std::string& s, unsigned int flags = match_default) { return Grep(v, s.c_str(), flags); }
|
||||
#ifndef BOOST_REGEX_NO_FILEITER
|
||||
unsigned int GrepFiles(GrepFileCallback cb, const char* files, bool recurse = false, unsigned int flags = match_default);
|
||||
unsigned int GrepFiles(GrepFileCallback cb, const std::string& files, bool recurse = false, unsigned int flags = match_default) { return GrepFiles(cb, files.c_str(), recurse, flags); }
|
||||
unsigned int FindFiles(FindFilesCallback cb, const char* files, bool recurse = false, unsigned int flags = match_default);
|
||||
unsigned int FindFiles(FindFilesCallback cb, const std::string& files, bool recurse = false, unsigned int flags = match_default) { return FindFiles(cb, files.c_str(), recurse, flags); }
|
||||
#endif
|
||||
|
||||
std::string Merge(const std::string& in, const std::string& fmt,
|
||||
bool copy = true, unsigned int flags = match_default);
|
||||
std::string Merge(const char* in, const char* fmt,
|
||||
bool copy = true, unsigned int flags = match_default);
|
||||
|
||||
std::size_t Split(std::vector<std::string>& v, std::string& s, unsigned flags = match_default, unsigned max_count = ~0);
|
||||
//
|
||||
// now operators for returning what matched in more detail:
|
||||
//
|
||||
std::size_t Position(int i = 0)const;
|
||||
std::size_t Length(int i = 0)const;
|
||||
bool Matched(int i = 0)const;
|
||||
unsigned int Line()const;
|
||||
unsigned int Marks()const;
|
||||
std::string What(int i = 0)const;
|
||||
std::string operator[](int i)const { return What(i); }
|
||||
|
||||
static const unsigned int npos;
|
||||
|
||||
friend struct re_detail::pred1;
|
||||
friend struct re_detail::pred2;
|
||||
friend struct re_detail::pred3;
|
||||
friend struct re_detail::pred4;
|
||||
};
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma option pop
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
|
||||
#endif // include guard
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -22,10 +22,12 @@
|
||||
* the form of class map_file.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_RE_FILEITER_HPP
|
||||
#define BOOST_RE_FILEITER_HPP
|
||||
#ifndef BOOST_RE_FILEITER_HPP_INCLUDED
|
||||
#define BOOST_RE_FILEITER_HPP_INCLUDED
|
||||
|
||||
#ifndef BOOST_REGEX_CONFIG_HPP
|
||||
#include <boost/regex/config.hpp>
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_REGEX_NO_FILEITER
|
||||
|
||||
@ -451,3 +453,4 @@ using boost::re_detail::mapfile;
|
||||
|
||||
|
||||
|
||||
|
@ -21,6 +21,9 @@
|
||||
* library rather than in the users object files.
|
||||
*/
|
||||
|
||||
//
|
||||
// note no include guard, we may include this multiple times:
|
||||
//
|
||||
#ifndef BOOST_REGEX_NO_EXTERNAL_TEMPLATES
|
||||
|
||||
namespace boost{
|
||||
@ -162,3 +165,4 @@ template void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::cow();
|
||||
#endif // BOOST_REGEX_NO_EXTERNAL_TEMPLATES
|
||||
|
||||
|
||||
|
1636
include/boost/regex/v3/regex.hpp
Normal file
1636
include/boost/regex/v3/regex.hpp
Normal file
File diff suppressed because it is too large
Load Diff
@ -1266,6 +1266,10 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expr
|
||||
# ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4127)
|
||||
#endif
|
||||
#ifdef __OpenBSD__
|
||||
// strxfrm not working on OpenBSD??
|
||||
f |= regbase::nocollate;
|
||||
#endif
|
||||
|
||||
if(p == expression())
|
||||
@ -1986,6 +1990,8 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::probe_re
|
||||
{
|
||||
case re_detail::syntax_element_startmark:
|
||||
case re_detail::syntax_element_endmark:
|
||||
if(static_cast<const re_detail::re_brace*>(dat)->index == -2)
|
||||
return regbase::restart_any;
|
||||
return probe_restart(dat->next.p);
|
||||
case re_detail::syntax_element_start_line:
|
||||
return regbase::restart_line;
|
||||
@ -2014,7 +2020,7 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::fixup_le
|
||||
if((leading_lit) && (static_cast<re_detail::re_literal*>(dat)->length > 2))
|
||||
{
|
||||
// we can do a literal search for the leading literal string
|
||||
// using Knuth-Morris-Pratt (or whatever), and only then check for
|
||||
// using Knuth-Morris-Pratt (or whatever), and only then check for
|
||||
// matches. We need a decent length string though to make it
|
||||
// worth while.
|
||||
_leading_string = reinterpret_cast<charT*>(reinterpret_cast<char*>(dat) + sizeof(re_detail::re_literal));
|
||||
@ -2062,10 +2068,14 @@ unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::fixup_le
|
||||
case re_detail::syntax_element_rep:
|
||||
if((len == 0) && (1 == fixup_leading_rep(dat->next.p, static_cast<re_detail::re_repeat*>(dat)->alt.p) ))
|
||||
{
|
||||
static_cast<re_detail::re_repeat*>(dat)->leading = true;
|
||||
static_cast<re_detail::re_repeat*>(dat)->leading = leading_lit;
|
||||
return len;
|
||||
}
|
||||
return len;
|
||||
case re_detail::syntax_element_startmark:
|
||||
if(static_cast<const re_detail::re_brace*>(dat)->index == -2)
|
||||
return 0;
|
||||
// fall through:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -2110,3 +2120,5 @@ void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::fail(unsigned in
|
||||
|
||||
|
||||
|
||||
|
||||
|
70
include/boost/regex/v3/regex_fwd.hpp
Normal file
70
include/boost/regex/v3/regex_fwd.hpp
Normal file
@ -0,0 +1,70 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1998-2002
|
||||
* Dr John Maddock
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Dr John Maddock makes no representations
|
||||
* about the suitability of this software for any purpose.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_fwd.cpp
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Forward declares boost::reg_expression<> and
|
||||
* associated typedefs.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_REGEX_FWD_HPP_INCLUDED
|
||||
#define BOOST_REGEX_FWD_HPP_INCLUDED
|
||||
|
||||
#ifndef BOOST_REGEX_CONFIG_HPP
|
||||
#include <boost/config.hpp>
|
||||
#endif
|
||||
#include <boost/detail/allocator.hpp>
|
||||
|
||||
//
|
||||
// define BOOST_REGEX_NO_FWD if this
|
||||
// header doesn't work!
|
||||
//
|
||||
#ifdef BOOST_REGEX_NO_FWD
|
||||
# ifndef BOOST_RE_REGEX_HPP
|
||||
# include <boost/regex.hpp>
|
||||
# endif
|
||||
#else
|
||||
|
||||
//
|
||||
// If there isn't good enough wide character support then there will
|
||||
// be no wide character regular expressions:
|
||||
//
|
||||
#if (defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_CWCTYPE) || defined(BOOST_NO_STD_WSTRING)) && !defined(BOOST_NO_WREGEX)
|
||||
# define BOOST_NO_WREGEX
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
|
||||
template <class charT>
|
||||
class regex_traits;
|
||||
|
||||
template <class charT, class traits = regex_traits<charT>, class Allocator = BOOST_DEFAULT_ALLOCATOR(charT) >
|
||||
class reg_expression;
|
||||
|
||||
typedef reg_expression<char, regex_traits<char>, BOOST_DEFAULT_ALLOCATOR(char) > regex;
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
typedef reg_expression<wchar_t, regex_traits<wchar_t>, BOOST_DEFAULT_ALLOCATOR(wchar_t) > wregex;
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_REGEX_NO_FWD
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -56,8 +56,10 @@ inline int string_compare(const std::basic_string<C,T,A>& s, const C* p)
|
||||
{ return s.compare(p); }
|
||||
inline int string_compare(const std::string& s, const char* p)
|
||||
{ return std::strcmp(s.c_str(), p); }
|
||||
# ifndef BOOST_NO_WREGEX
|
||||
inline int string_compare(const std::wstring& s, const wchar_t* p)
|
||||
{ return std::wcscmp(s.c_str(), p); }
|
||||
# endif
|
||||
# define STR_COMP(s,p) string_compare(s,p)
|
||||
#endif
|
||||
|
||||
@ -213,7 +215,11 @@ public:
|
||||
}
|
||||
void estimate_max_state_count(iterator a, iterator b, std::size_t states, std::random_access_iterator_tag*)
|
||||
{
|
||||
#ifndef BOOST_NO_STD_DISTANCE
|
||||
difference_type dist = std::distance(a,b);
|
||||
#else
|
||||
difference_type dist = b - a;
|
||||
#endif
|
||||
states *= states;
|
||||
difference_type lim = std::numeric_limits<difference_type>::max() - 1000 - states;
|
||||
if(dist > (difference_type)(lim / states))
|
||||
@ -749,6 +755,15 @@ bool query_match_aux(iterator first,
|
||||
start_loop[cur_acc] = first;
|
||||
continue;
|
||||
}
|
||||
else if((unsigned int)accumulators[cur_acc] < static_cast<const re_repeat*>(ptr)->min)
|
||||
{
|
||||
// the repeat was null, and we haven't gone round min times yet,
|
||||
// since all subsequent repeats will be null as well, just update
|
||||
// our repeat count and skip out.
|
||||
accumulators[cur_acc] = static_cast<const re_repeat*>(ptr)->min;
|
||||
ptr = static_cast<const re_repeat*>(ptr)->alt.p;
|
||||
continue;
|
||||
}
|
||||
goto failure;
|
||||
}
|
||||
// see if we can skip the repeat:
|
||||
@ -805,6 +820,15 @@ bool query_match_aux(iterator first,
|
||||
start_loop[cur_acc] = first;
|
||||
continue;
|
||||
}
|
||||
else if((first == start_loop[cur_acc]) && accumulators[cur_acc] && ((unsigned int)accumulators[cur_acc] < static_cast<const re_repeat*>(ptr)->min))
|
||||
{
|
||||
// the repeat was null, and we haven't gone round min times yet,
|
||||
// since all subsequent repeats will be null as well, just update
|
||||
// our repeat count and skip out.
|
||||
accumulators[cur_acc] = static_cast<const re_repeat*>(ptr)->min;
|
||||
ptr = static_cast<const re_repeat*>(ptr)->alt.p;
|
||||
continue;
|
||||
}
|
||||
|
||||
// if we get here then neither option is allowed so fail:
|
||||
goto failure;
|
||||
@ -822,7 +846,7 @@ bool query_match_aux(iterator first,
|
||||
if(flags & match_not_eob)
|
||||
goto failure;
|
||||
iterator p(first);
|
||||
while((p != last) && traits_inst.is_separator(traits_inst.translate(*first, icase)))++p;
|
||||
while((p != last) && traits_inst.is_separator(traits_inst.translate(*p, icase)))++p;
|
||||
if(p != last)
|
||||
goto failure;
|
||||
ptr = ptr->next.p;
|
||||
@ -954,6 +978,12 @@ bool query_match_aux(iterator first,
|
||||
goto failure;
|
||||
ptr = ptr->next.p;
|
||||
continue;
|
||||
case syntax_element_backref:
|
||||
if(temp_match[static_cast<const re_brace*>(ptr)->index].first
|
||||
!= temp_match[static_cast<const re_brace*>(ptr)->index].second)
|
||||
goto failure;
|
||||
ptr = ptr->next.p;
|
||||
continue;
|
||||
default:
|
||||
goto failure;
|
||||
}
|
||||
@ -1225,6 +1255,7 @@ unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<char
|
||||
I next_base;
|
||||
I base = first;
|
||||
bool need_init;
|
||||
bool leading_match = false;
|
||||
const traits& traits_inst = e.get_traits();
|
||||
// dwa 9/13/00 suppress incorrect MSVC warning - it claims this is never
|
||||
// referenced
|
||||
@ -1258,6 +1289,7 @@ unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<char
|
||||
if(query_match_aux(first, last, m, e, flags, pd, &restart))
|
||||
{
|
||||
++cmatches;
|
||||
leading_match = true;
|
||||
if(foo(m) == false)
|
||||
return cmatches;
|
||||
if(m[0].second == last)
|
||||
@ -1280,6 +1312,7 @@ unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<char
|
||||
else
|
||||
{
|
||||
need_init = false;
|
||||
leading_match = false;
|
||||
for(unsigned int i = 0; (restart != first) && (i < access::leading_length(e)); ++i, --restart)
|
||||
{} // dwa 10/20/2000 - warning suppression for MWCW
|
||||
if(restart != last)
|
||||
@ -1623,6 +1656,8 @@ unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<char
|
||||
break;
|
||||
case regbase::restart_continue:
|
||||
{
|
||||
if(!leading_match)
|
||||
return cmatches;
|
||||
while(first != last)
|
||||
{
|
||||
if( access::can_start(*first, _map, (unsigned char)mask_any) )
|
||||
@ -1982,3 +2017,4 @@ inline unsigned int regex_grep(bool (*foo)(const match_results<std::basic_string
|
||||
|
||||
|
||||
|
||||
|
@ -36,7 +36,7 @@ namespace re_detail{
|
||||
template <class charT>
|
||||
const reg_expression<charT>& get_default_expression(charT)
|
||||
{
|
||||
static const charT expression_text[] = { '\\', 's', '+', '\00', };
|
||||
static const charT expression_text[4] = { '\\', 's', '+', '\00', };
|
||||
static const reg_expression<charT> e(expression_text);
|
||||
return e;
|
||||
}
|
||||
@ -149,3 +149,4 @@ inline std::size_t regex_split(OutputIterator out,
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <boost/regex/config.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_RAW_BUFFER_HPP
|
||||
#include <boost/regex/detail/regex_raw_buffer.hpp>
|
||||
#include <boost/regex/v3/regex_raw_buffer.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
@ -224,3 +224,4 @@ jstack<T, Allocator>::~jstack()
|
||||
|
||||
|
||||
|
||||
|
815
include/boost/regex/v3/regex_traits.hpp
Normal file
815
include/boost/regex/v3/regex_traits.hpp
Normal file
@ -0,0 +1,815 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1998-2002
|
||||
* Dr John Maddock
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Dr John Maddock makes no representations
|
||||
* about the suitability of this software for any purpose.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_traits.hpp
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Declares regular expression traits classes.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_REGEX_TRAITS_HPP_INCLUDED
|
||||
#define BOOST_REGEX_TRAITS_HPP_INCLUDED
|
||||
|
||||
#ifndef BOOST_RE_CREGEX_HPP
|
||||
#include <boost/cregex.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_REGEX_CSTRING_HPP
|
||||
#include <boost/regex/v3/regex_cstring.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma option push -a8 -b -Vx -Ve -pc
|
||||
#endif
|
||||
|
||||
template <class charT>
|
||||
class c_regex_traits;
|
||||
|
||||
namespace re_detail{
|
||||
|
||||
struct mss
|
||||
{
|
||||
unsigned int id;
|
||||
const char* what;
|
||||
};
|
||||
|
||||
BOOST_REGEX_DECL bool BOOST_REGEX_CALL re_lookup_def_collate_name(std::string& buf, const char* name);
|
||||
BOOST_REGEX_DECL std::size_t BOOST_REGEX_CALL re_get_default_message(char* buf, std::size_t len, std::size_t id);
|
||||
extern BOOST_REGEX_DECL const char *re_default_error_messages[];
|
||||
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
extern BOOST_REGEX_DECL wchar_t wide_lower_case_map[];
|
||||
extern BOOST_REGEX_DECL unsigned short wide_unicode_classes[];
|
||||
BOOST_REGEX_DECL bool BOOST_REGEX_CALL is_combining(wchar_t c);
|
||||
#endif
|
||||
|
||||
|
||||
struct BOOST_REGEX_DECL regex_traits_base
|
||||
{
|
||||
enum char_syntax_type
|
||||
{
|
||||
syntax_char = 0,
|
||||
syntax_open_bracket = 1, // (
|
||||
syntax_close_bracket = 2, // )
|
||||
syntax_dollar = 3, // $
|
||||
syntax_caret = 4, // ^
|
||||
syntax_dot = 5, // .
|
||||
syntax_star = 6, // *
|
||||
syntax_plus = 7, // +
|
||||
syntax_question = 8, // ?
|
||||
syntax_open_set = 9, // [
|
||||
syntax_close_set = 10, // ]
|
||||
syntax_or = 11, // |
|
||||
syntax_slash = 12, //
|
||||
syntax_hash = 13, // #
|
||||
syntax_dash = 14, // -
|
||||
syntax_open_brace = 15, // {
|
||||
syntax_close_brace = 16, // }
|
||||
syntax_digit = 17, // 0-9
|
||||
syntax_b = 18, // for \b
|
||||
syntax_B = 19, // for \B
|
||||
syntax_left_word = 20, // for \<
|
||||
syntax_right_word = 21, // for \>
|
||||
syntax_w = 22, // for \w
|
||||
syntax_W = 23, // for \W
|
||||
syntax_start_buffer = 24, // for \`
|
||||
syntax_end_buffer = 25, // for \'
|
||||
syntax_newline = 26, // for newline alt
|
||||
syntax_comma = 27, // for {x,y}
|
||||
|
||||
syntax_a = 28, // for \a
|
||||
syntax_f = 29, // for \f
|
||||
syntax_n = 30, // for \n
|
||||
syntax_r = 31, // for \r
|
||||
syntax_t = 32, // for \t
|
||||
syntax_v = 33, // for \v
|
||||
syntax_x = 34, // for \xdd
|
||||
syntax_c = 35, // for \cx
|
||||
syntax_colon = 36, // for [:...:]
|
||||
syntax_equal = 37, // for [=...=]
|
||||
|
||||
// perl ops:
|
||||
syntax_e = 38, // for \e
|
||||
syntax_l = 39, // for \l
|
||||
syntax_L = 40, // for \L
|
||||
syntax_u = 41, // for \u
|
||||
syntax_U = 42, // for \U
|
||||
syntax_s = 43, // for \s
|
||||
syntax_S = 44, // for \S
|
||||
syntax_d = 45, // for \d
|
||||
syntax_D = 46, // for \D
|
||||
syntax_E = 47, // for \Q\E
|
||||
syntax_Q = 48, // for \Q\E
|
||||
syntax_X = 49, // for \X
|
||||
syntax_C = 50, // for \C
|
||||
syntax_Z = 51, // for \Z
|
||||
syntax_G = 52, // for \G
|
||||
|
||||
// new extentions:
|
||||
syntax_not = 53, // for (?!...)
|
||||
|
||||
syntax_max = 54
|
||||
};
|
||||
#ifdef __BORLANDC__
|
||||
private:
|
||||
char dummy_member;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct BOOST_REGEX_DECL c_traits_base : public regex_traits_base
|
||||
{
|
||||
public:
|
||||
enum{
|
||||
char_class_none = 0,
|
||||
char_class_alpha = 0x0001,
|
||||
char_class_cntrl = 0x0002,
|
||||
char_class_digit = 0x0004,
|
||||
char_class_lower = 0x0008,
|
||||
char_class_punct = 0x0010,
|
||||
char_class_space = 0x0020,
|
||||
char_class_upper = 0x0040,
|
||||
char_class_xdigit = 0x0080,
|
||||
char_class_blank = 0x0100,
|
||||
char_class_underscore = 0x4000,
|
||||
char_class_unicode = 0x8000,
|
||||
|
||||
char_class_alnum = char_class_alpha | char_class_digit,
|
||||
char_class_graph = char_class_alpha | char_class_digit | char_class_punct | char_class_underscore,
|
||||
char_class_print = char_class_alpha | char_class_digit | char_class_punct | char_class_underscore | char_class_blank,
|
||||
char_class_word = char_class_alpha | char_class_digit | char_class_underscore
|
||||
};
|
||||
static std::string BOOST_REGEX_CALL set_message_catalogue(const std::string& s);
|
||||
protected:
|
||||
#if defined(__MWERKS__) && __MWERKS__ <= 0x6000
|
||||
friend class c_regex_traits<char>;
|
||||
friend class c_regex_traits<wchar_t>;
|
||||
#endif
|
||||
|
||||
static char regex_message_catalogue[BOOST_REGEX_MAX_PATH];
|
||||
enum syntax_map_size
|
||||
{
|
||||
map_size = UCHAR_MAX + 1
|
||||
};
|
||||
|
||||
static unsigned char syntax_map[map_size];
|
||||
static unsigned short class_map[map_size];
|
||||
static char lower_case_map[map_size];
|
||||
|
||||
static boost::uint_fast32_t BOOST_REGEX_CALL do_lookup_class(const char* p);
|
||||
static bool BOOST_REGEX_CALL do_lookup_collate(std::string& buf, const char* p);
|
||||
static void BOOST_REGEX_CALL do_update_ctype();
|
||||
static void BOOST_REGEX_CALL do_update_collate();
|
||||
public:
|
||||
static std::string BOOST_REGEX_CALL error_string(unsigned id);
|
||||
static char* BOOST_REGEX_CALL get_catalogue() { return regex_message_catalogue; }
|
||||
};
|
||||
|
||||
} // namespace re_detail
|
||||
|
||||
|
||||
template<>
|
||||
class BOOST_REGEX_DECL c_regex_traits<char> : public re_detail::c_traits_base
|
||||
{
|
||||
typedef re_detail::c_traits_base base_type;
|
||||
public:
|
||||
typedef char char_type;
|
||||
typedef unsigned char uchar_type;
|
||||
typedef unsigned int size_type;
|
||||
typedef std::string string_type;
|
||||
typedef int locale_type;
|
||||
|
||||
static std::size_t BOOST_REGEX_CALL length(const char_type* p)
|
||||
{
|
||||
return std::strlen(p);
|
||||
}
|
||||
static unsigned int BOOST_REGEX_CALL syntax_type(size_type c)
|
||||
{
|
||||
return syntax_map[c];
|
||||
}
|
||||
static char BOOST_REGEX_CALL translate(char c, bool icase)
|
||||
{
|
||||
return icase ? lower_case_map[(size_type)(uchar_type)c] : c;
|
||||
}
|
||||
static void BOOST_REGEX_CALL transform(std::string& out, const std::string& in);
|
||||
|
||||
static void BOOST_REGEX_CALL transform_primary(std::string& out, const std::string& in);
|
||||
|
||||
static bool BOOST_REGEX_CALL is_separator(char c)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL((c == '\n') || (c == '\r'));
|
||||
}
|
||||
|
||||
static bool BOOST_REGEX_CALL is_combining(char)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool BOOST_REGEX_CALL is_class(char c, boost::uint_fast32_t f)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL(class_map[(size_type)(uchar_type)c] & f);
|
||||
}
|
||||
|
||||
static int BOOST_REGEX_CALL toi(char c);
|
||||
static int BOOST_REGEX_CALL toi(const char*& first, const char* last, int radix);
|
||||
|
||||
static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const char* first, const char* last)
|
||||
{
|
||||
std::string s(first, last);
|
||||
return do_lookup_class(s.c_str());
|
||||
}
|
||||
|
||||
static bool BOOST_REGEX_CALL lookup_collatename(std::string& buf, const char* first, const char* last)
|
||||
{
|
||||
std::string s(first, last);
|
||||
return do_lookup_collate(buf, s.c_str());
|
||||
}
|
||||
|
||||
static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
|
||||
locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
|
||||
|
||||
c_regex_traits()
|
||||
{
|
||||
init();
|
||||
}
|
||||
~c_regex_traits()
|
||||
{
|
||||
m_free();
|
||||
}
|
||||
struct sentry
|
||||
{
|
||||
sentry(const c_regex_traits<char>&)
|
||||
{ c_regex_traits<char>::update(); }
|
||||
operator void*() { return this; }
|
||||
};
|
||||
static void BOOST_REGEX_CALL update();
|
||||
private:
|
||||
static void BOOST_REGEX_CALL init();
|
||||
static void BOOST_REGEX_CALL m_free();
|
||||
static c_regex_traits<char> i;
|
||||
|
||||
static unsigned sort_type;
|
||||
static char sort_delim;
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
template<>
|
||||
class BOOST_REGEX_DECL c_regex_traits<wchar_t> : public re_detail::c_traits_base
|
||||
{
|
||||
typedef re_detail::c_traits_base base_type;
|
||||
public:
|
||||
typedef wchar_t char_type;
|
||||
typedef unsigned short uchar_type;
|
||||
typedef unsigned int size_type;
|
||||
typedef std::basic_string<wchar_t> string_type;
|
||||
typedef int locale_type;
|
||||
static std::size_t BOOST_REGEX_CALL length(const char_type* p)
|
||||
{
|
||||
return std::wcslen(p);
|
||||
}
|
||||
static unsigned int BOOST_REGEX_CALL syntax_type(size_type c);
|
||||
static wchar_t BOOST_REGEX_CALL translate(wchar_t c, bool icase)
|
||||
{
|
||||
return icase ? ((c < 256) ? re_detail::wide_lower_case_map[(uchar_type)c] : std::towlower(c)) : c;
|
||||
}
|
||||
|
||||
static void BOOST_REGEX_CALL transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
|
||||
|
||||
static void BOOST_REGEX_CALL transform_primary(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
|
||||
|
||||
static bool BOOST_REGEX_CALL is_separator(wchar_t c)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029));
|
||||
}
|
||||
|
||||
static bool BOOST_REGEX_CALL is_combining(wchar_t c)
|
||||
{ return re_detail::is_combining(c); }
|
||||
|
||||
static bool BOOST_REGEX_CALL is_class(wchar_t c, boost::uint_fast32_t f)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL(((uchar_type)c < 256) ? (re_detail::wide_unicode_classes[(size_type)(uchar_type)c] & f) : do_iswclass(c, f));
|
||||
}
|
||||
|
||||
static int BOOST_REGEX_CALL toi(wchar_t c);
|
||||
static int BOOST_REGEX_CALL toi(const wchar_t*& first, const wchar_t* last, int radix);
|
||||
|
||||
static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last);
|
||||
|
||||
static bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<wchar_t>& s, const wchar_t* first, const wchar_t* last);
|
||||
|
||||
static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
|
||||
locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
|
||||
c_regex_traits<wchar_t>()
|
||||
{ init(); }
|
||||
~c_regex_traits<wchar_t>()
|
||||
{ m_free(); }
|
||||
struct sentry
|
||||
{
|
||||
sentry(const c_regex_traits<wchar_t>&)
|
||||
{ c_regex_traits<wchar_t>::update(); }
|
||||
operator void*() { return this; }
|
||||
};
|
||||
static void BOOST_REGEX_CALL update();
|
||||
static std::size_t BOOST_REGEX_CALL strnarrow(char *s1, std::size_t len, const wchar_t *s2);
|
||||
static std::size_t BOOST_REGEX_CALL strwiden(wchar_t *s1, std::size_t 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 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_;
|
||||
|
||||
static unsigned sort_type;
|
||||
static wchar_t sort_delim;
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
|
||||
|
||||
namespace re_detail{
|
||||
|
||||
struct BOOST_REGEX_DECL w32_traits_base : public regex_traits_base
|
||||
{
|
||||
enum{
|
||||
char_class_none = 0,
|
||||
char_class_alnum = C1_ALPHA | C1_DIGIT,
|
||||
char_class_alpha = C1_ALPHA,
|
||||
char_class_cntrl = C1_CNTRL,
|
||||
char_class_digit = C1_DIGIT,
|
||||
char_class_graph = C1_UPPER | C1_LOWER | C1_DIGIT | C1_PUNCT | C1_ALPHA,
|
||||
char_class_lower = C1_LOWER,
|
||||
char_class_print = C1_UPPER | C1_LOWER | C1_DIGIT | C1_PUNCT | C1_BLANK | C1_ALPHA,
|
||||
char_class_punct = C1_PUNCT,
|
||||
char_class_space = C1_SPACE,
|
||||
char_class_upper = C1_UPPER,
|
||||
char_class_xdigit = C1_XDIGIT,
|
||||
char_class_blank = C1_BLANK,
|
||||
char_class_underscore = 0x4000,
|
||||
char_class_word = C1_ALPHA | C1_DIGIT | char_class_underscore,
|
||||
char_class_unicode = 0x8000,
|
||||
char_class_win = 0x01FF
|
||||
};
|
||||
|
||||
|
||||
public:
|
||||
static std::string BOOST_REGEX_CALL set_message_catalogue(const std::string& s);
|
||||
protected:
|
||||
static char regex_message_catalogue[BOOST_REGEX_MAX_PATH];
|
||||
enum syntax_map_size
|
||||
{
|
||||
map_size = UCHAR_MAX + 1
|
||||
};
|
||||
|
||||
static unsigned char syntax_map[map_size];
|
||||
static unsigned short class_map[map_size];
|
||||
static char lower_case_map[map_size];
|
||||
|
||||
static boost::uint_fast32_t BOOST_REGEX_CALL do_lookup_class(const char* p);
|
||||
static bool BOOST_REGEX_CALL do_lookup_collate(std::string& buf, const char* p);
|
||||
static void BOOST_REGEX_CALL do_free();
|
||||
static void BOOST_REGEX_CALL do_init();
|
||||
public:
|
||||
static std::string BOOST_REGEX_CALL error_string(unsigned id);
|
||||
static char* BOOST_REGEX_CALL get_catalogue() { return regex_message_catalogue; }
|
||||
};
|
||||
|
||||
|
||||
} // namespace re_detail
|
||||
|
||||
template<class charT>
|
||||
class w32_regex_traits;
|
||||
|
||||
template<>
|
||||
class BOOST_REGEX_DECL w32_regex_traits<char> : public re_detail::w32_traits_base
|
||||
{
|
||||
typedef re_detail::w32_traits_base base_type;
|
||||
public:
|
||||
typedef char char_type;
|
||||
typedef unsigned char uchar_type;
|
||||
typedef unsigned int size_type;
|
||||
typedef std::string string_type;
|
||||
typedef int locale_type;
|
||||
|
||||
static std::size_t BOOST_REGEX_CALL length(const char_type* p)
|
||||
{
|
||||
return std::strlen(p);
|
||||
}
|
||||
static unsigned int BOOST_REGEX_CALL syntax_type(size_type c)
|
||||
{
|
||||
return syntax_map[c];
|
||||
}
|
||||
static char BOOST_REGEX_CALL translate(char c, bool icase)
|
||||
{
|
||||
return icase ? lower_case_map[(size_type)(uchar_type)c] : c;
|
||||
}
|
||||
static void BOOST_REGEX_CALL transform(std::string& out, const std::string& in);
|
||||
|
||||
static void BOOST_REGEX_CALL transform_primary(std::string& out, const std::string& in);
|
||||
|
||||
static bool BOOST_REGEX_CALL is_separator(char c)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL((c == '\n') || (c == '\r'));
|
||||
}
|
||||
|
||||
static bool BOOST_REGEX_CALL is_combining(char)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool BOOST_REGEX_CALL is_class(char c, boost::uint_fast32_t f)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL(class_map[(size_type)(uchar_type)c] & f);
|
||||
}
|
||||
|
||||
static int BOOST_REGEX_CALL toi(char c);
|
||||
static int BOOST_REGEX_CALL toi(const char*& first, const char* last, int radix);
|
||||
|
||||
static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const char* first, const char* last)
|
||||
{
|
||||
std::string s(first, last);
|
||||
return do_lookup_class(s.c_str());
|
||||
}
|
||||
|
||||
static bool BOOST_REGEX_CALL lookup_collatename(std::string& buf, const char* first, const char* last)
|
||||
{
|
||||
std::string s(first, last);
|
||||
return do_lookup_collate(buf, s.c_str());
|
||||
}
|
||||
|
||||
static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
|
||||
locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
|
||||
|
||||
struct sentry
|
||||
{
|
||||
sentry(const w32_regex_traits<char>&)
|
||||
{ w32_regex_traits<char>::update(); }
|
||||
~sentry(){}
|
||||
operator void*() { return this; }
|
||||
};
|
||||
static void BOOST_REGEX_CALL update();
|
||||
w32_regex_traits();
|
||||
~w32_regex_traits();
|
||||
private:
|
||||
static w32_regex_traits<char> i;
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
template<>
|
||||
class BOOST_REGEX_DECL w32_regex_traits<wchar_t> : public re_detail::w32_traits_base
|
||||
{
|
||||
typedef re_detail::w32_traits_base base_type;
|
||||
public:
|
||||
typedef wchar_t char_type;
|
||||
typedef unsigned short uchar_type;
|
||||
typedef unsigned int size_type;
|
||||
typedef std::basic_string<wchar_t> string_type;
|
||||
typedef int locale_type;
|
||||
static std::size_t BOOST_REGEX_CALL length(const char_type* p)
|
||||
{
|
||||
return std::wcslen(p);
|
||||
}
|
||||
static unsigned int BOOST_REGEX_CALL syntax_type(size_type c);
|
||||
static wchar_t BOOST_REGEX_CALL translate(wchar_t c, bool icase)
|
||||
{
|
||||
return icase ? ((c < 256) ? re_detail::wide_lower_case_map[(uchar_type)c] : wtolower(c)) : c;
|
||||
}
|
||||
|
||||
static void BOOST_REGEX_CALL transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
|
||||
|
||||
static void BOOST_REGEX_CALL transform_primary(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
|
||||
|
||||
static bool BOOST_REGEX_CALL is_separator(wchar_t c)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029));
|
||||
}
|
||||
|
||||
static bool BOOST_REGEX_CALL is_combining(wchar_t c)
|
||||
{ return re_detail::is_combining(c); }
|
||||
|
||||
static bool BOOST_REGEX_CALL is_class(wchar_t c, boost::uint_fast32_t f)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL(((uchar_type)c < 256) ? (wide_unicode_classes[(size_type)(uchar_type)c] & f) : do_iswclass(c, f));
|
||||
}
|
||||
|
||||
static int BOOST_REGEX_CALL toi(wchar_t c);
|
||||
static int BOOST_REGEX_CALL toi(const wchar_t*& first, const wchar_t* last, int radix);
|
||||
|
||||
static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last);
|
||||
|
||||
static bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<wchar_t>& s, const wchar_t* first, const wchar_t* last);
|
||||
|
||||
static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
|
||||
locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
|
||||
|
||||
struct sentry
|
||||
{
|
||||
sentry(const w32_regex_traits<wchar_t>&)
|
||||
{ w32_regex_traits<wchar_t>::update(); }
|
||||
~sentry(){}
|
||||
operator void*() { return this; }
|
||||
};
|
||||
static void BOOST_REGEX_CALL update();
|
||||
w32_regex_traits();
|
||||
~w32_regex_traits();
|
||||
static std::size_t BOOST_REGEX_CALL strnarrow(char *s1, std::size_t len, const wchar_t *s2);
|
||||
static std::size_t BOOST_REGEX_CALL strwiden(wchar_t *s1, std::size_t len, const char *s2);
|
||||
|
||||
private:
|
||||
static bool BOOST_REGEX_CALL do_iswclass(wchar_t c, boost::uint_fast32_t f);
|
||||
static bool BOOST_REGEX_CALL do_lookup_collate(std::basic_string<wchar_t>& out, const wchar_t* first, const wchar_t* last);
|
||||
static w32_regex_traits<wchar_t> init_;
|
||||
static wchar_t BOOST_REGEX_CALL wtolower(wchar_t c);
|
||||
static unsigned short wide_unicode_classes[];
|
||||
};
|
||||
#endif // Wide strings
|
||||
#endif // Win32
|
||||
|
||||
#if !defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_WSTREAMBUF)
|
||||
|
||||
} // namspace boost
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma option pop
|
||||
#endif
|
||||
#include <locale>
|
||||
#ifdef __BORLANDC__
|
||||
#pragma option push -a4 -b -Ve -pc
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
|
||||
namespace re_detail
|
||||
{
|
||||
|
||||
template <class charT>
|
||||
struct message_data;
|
||||
|
||||
template <>
|
||||
struct message_data<char>;
|
||||
|
||||
template <>
|
||||
struct message_data<wchar_t>;
|
||||
|
||||
struct BOOST_REGEX_DECL cpp_regex_traits_base : public regex_traits_base
|
||||
{
|
||||
enum char_class_type
|
||||
{
|
||||
char_class_none = 0,
|
||||
char_class_alnum = std::ctype_base::alnum,
|
||||
char_class_alpha = std::ctype_base::alpha,
|
||||
char_class_cntrl = std::ctype_base::cntrl,
|
||||
char_class_digit = std::ctype_base::digit,
|
||||
char_class_graph = std::ctype_base::graph,
|
||||
char_class_lower = std::ctype_base::lower,
|
||||
char_class_print = std::ctype_base::print,
|
||||
char_class_punct = std::ctype_base::punct,
|
||||
char_class_space = std::ctype_base::space,
|
||||
char_class_upper = std::ctype_base::upper,
|
||||
char_class_xdigit = std::ctype_base::xdigit,
|
||||
char_class_blank = 1<<12,
|
||||
char_class_underscore = 1<<13,
|
||||
char_class_word = std::ctype_base::alnum | char_class_underscore,
|
||||
char_class_unicode = 1<<14,
|
||||
char_class_all_base = char_class_alnum | char_class_alpha | char_class_cntrl
|
||||
| char_class_digit | char_class_graph | char_class_lower
|
||||
| char_class_print | char_class_punct | char_class_space
|
||||
| char_class_upper | char_class_xdigit
|
||||
};
|
||||
|
||||
static std::string BOOST_REGEX_CALL set_message_catalogue(const std::string& s);
|
||||
protected:
|
||||
static char regex_message_cat[BOOST_REGEX_MAX_PATH];
|
||||
};
|
||||
|
||||
} // namespace re_detail
|
||||
|
||||
template <class charT>
|
||||
class cpp_regex_traits;
|
||||
|
||||
template<>
|
||||
class BOOST_REGEX_DECL cpp_regex_traits<char> : public re_detail::cpp_regex_traits_base
|
||||
{
|
||||
typedef re_detail::cpp_regex_traits_base base_type;
|
||||
private:
|
||||
re_detail::message_data<char>* pmd;
|
||||
const unsigned char* psyntax;
|
||||
char* lower_map;
|
||||
const std::ctype<char>* pctype;
|
||||
const std::collate<char>* pcollate;
|
||||
std::locale locale_inst;
|
||||
unsigned sort_type;
|
||||
char sort_delim;
|
||||
|
||||
cpp_regex_traits(const cpp_regex_traits&);
|
||||
cpp_regex_traits& operator=(const cpp_regex_traits&);
|
||||
|
||||
public:
|
||||
typedef char char_type;
|
||||
typedef unsigned char uchar_type;
|
||||
typedef unsigned int size_type;
|
||||
typedef std::string string_type;
|
||||
typedef std::locale locale_type;
|
||||
|
||||
cpp_regex_traits();
|
||||
~cpp_regex_traits();
|
||||
|
||||
static std::size_t BOOST_REGEX_CALL length(const char_type* p)
|
||||
{
|
||||
return std::strlen(p);
|
||||
}
|
||||
unsigned int BOOST_REGEX_CALL syntax_type(size_type c)const
|
||||
{
|
||||
return psyntax[c];
|
||||
}
|
||||
char BOOST_REGEX_CALL translate(char c, bool icase)const
|
||||
{
|
||||
return icase ? lower_map[(size_type)(uchar_type)c] : c;
|
||||
}
|
||||
void BOOST_REGEX_CALL transform(std::string& out, const std::string& in)const
|
||||
{
|
||||
out = pcollate->transform(in.c_str(), in.c_str() + in.size()).c_str();
|
||||
}
|
||||
|
||||
void BOOST_REGEX_CALL transform_primary(std::string& out, const std::string& in)const;
|
||||
|
||||
static bool BOOST_REGEX_CALL is_separator(char c)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL((c == '\n') || (c == '\r'));
|
||||
}
|
||||
|
||||
static bool BOOST_REGEX_CALL is_combining(char)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BOOST_REGEX_CALL is_class(char c, boost::uint_fast32_t f)const
|
||||
{
|
||||
if(pctype->is((std::ctype<char>::mask)(f & char_class_all_base), c))
|
||||
return true;
|
||||
if((f & char_class_underscore) && (c == '_'))
|
||||
return true;
|
||||
if((f & char_class_blank) && ((c == ' ') || (c == '\t')))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
int BOOST_REGEX_CALL toi(char c)const;
|
||||
int BOOST_REGEX_CALL toi(const char*& first, const char* last, int radix)const;
|
||||
|
||||
boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const char* first, const char* last)const;
|
||||
bool BOOST_REGEX_CALL lookup_collatename(std::string& s, const char* first, const char* last)const;
|
||||
|
||||
std::string BOOST_REGEX_CALL error_string(unsigned id)const;
|
||||
locale_type BOOST_REGEX_CALL imbue(locale_type l);
|
||||
locale_type BOOST_REGEX_CALL getloc()const{ return locale_inst; }
|
||||
|
||||
struct sentry
|
||||
{
|
||||
sentry(const cpp_regex_traits<char>&){}
|
||||
operator void*() { return this; }
|
||||
};
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
template<>
|
||||
class BOOST_REGEX_DECL cpp_regex_traits<wchar_t> : public re_detail::cpp_regex_traits_base
|
||||
{
|
||||
typedef re_detail::cpp_regex_traits_base base_type;
|
||||
public:
|
||||
typedef wchar_t char_type;
|
||||
typedef unsigned short uchar_type;
|
||||
typedef unsigned int size_type;
|
||||
typedef std::basic_string<wchar_t> string_type;
|
||||
typedef std::locale locale_type;
|
||||
|
||||
private:
|
||||
re_detail::message_data<wchar_t>* pmd;
|
||||
const unsigned char* psyntax;
|
||||
wchar_t* lower_map;
|
||||
const std::ctype<wchar_t>* pctype;
|
||||
const std::collate<wchar_t>* pcollate;
|
||||
const std::codecvt<wchar_t, char, std::mbstate_t>* pcdv;
|
||||
std::locale locale_inst;
|
||||
unsigned int BOOST_REGEX_CALL do_syntax_type(size_type c)const;
|
||||
unsigned sort_type;
|
||||
wchar_t sort_delim;
|
||||
|
||||
cpp_regex_traits(const cpp_regex_traits&);
|
||||
cpp_regex_traits& operator=(const cpp_regex_traits&);
|
||||
|
||||
public:
|
||||
|
||||
static std::size_t BOOST_REGEX_CALL length(const char_type* p)
|
||||
{
|
||||
return std::wcslen(p);
|
||||
}
|
||||
unsigned int BOOST_REGEX_CALL syntax_type(size_type c)const
|
||||
{
|
||||
return (c < UCHAR_MAX) ? psyntax[c] : do_syntax_type(c);
|
||||
}
|
||||
wchar_t BOOST_REGEX_CALL translate(wchar_t c, bool icase)const
|
||||
{
|
||||
return icase ? (((uchar_type)c) <= UCHAR_MAX) ? lower_map[c] : pctype->tolower(c) : c;
|
||||
}
|
||||
void BOOST_REGEX_CALL transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in)const
|
||||
{
|
||||
out = pcollate->transform(in.c_str(), in.c_str() + in.size());
|
||||
}
|
||||
|
||||
void BOOST_REGEX_CALL transform_primary(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in)const;
|
||||
|
||||
static bool BOOST_REGEX_CALL is_separator(wchar_t c)
|
||||
{
|
||||
return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029));
|
||||
}
|
||||
|
||||
static bool BOOST_REGEX_CALL is_combining(wchar_t c)
|
||||
{ return re_detail::is_combining(c); }
|
||||
|
||||
bool BOOST_REGEX_CALL is_class(wchar_t c, boost::uint_fast32_t f)const
|
||||
{
|
||||
if(pctype->is((std::ctype<wchar_t>::mask)(f & char_class_all_base), c))
|
||||
return true;
|
||||
if((f & char_class_underscore) && (c == '_'))
|
||||
return true;
|
||||
if((f & char_class_blank) && ((c == ' ') || (c == '\t')))
|
||||
return true;
|
||||
if((f & char_class_unicode) && ((uchar_type)c > (uchar_type)255))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
int BOOST_REGEX_CALL toi(wchar_t c)const;
|
||||
int BOOST_REGEX_CALL toi(const wchar_t*& first, const wchar_t* last, int radix)const;
|
||||
|
||||
boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last)const;
|
||||
bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<wchar_t>& s, const wchar_t* first, const wchar_t* last)const;
|
||||
|
||||
std::string BOOST_REGEX_CALL error_string(unsigned id)const;
|
||||
cpp_regex_traits();
|
||||
~cpp_regex_traits();
|
||||
locale_type BOOST_REGEX_CALL imbue(locale_type l);
|
||||
locale_type BOOST_REGEX_CALL getloc()const{ return locale_inst; }
|
||||
std::size_t BOOST_REGEX_CALL strwiden(wchar_t *s1, std::size_t len, const char *s2)const;
|
||||
|
||||
struct sentry
|
||||
{
|
||||
sentry(const cpp_regex_traits<wchar_t>&){}
|
||||
operator void*() { return this; }
|
||||
};
|
||||
};
|
||||
#endif // BOOST_NO_WREGEX
|
||||
|
||||
#endif // BOOST_NO_STD_LOCALE
|
||||
|
||||
#ifdef BOOST_REGEX_USE_WIN32_LOCALE
|
||||
|
||||
template <class charT>
|
||||
class regex_traits : public w32_regex_traits<charT>
|
||||
{
|
||||
};
|
||||
|
||||
#elif defined(BOOST_REGEX_USE_C_LOCALE)
|
||||
|
||||
template <class charT>
|
||||
class regex_traits : public c_regex_traits<charT>
|
||||
{
|
||||
};
|
||||
|
||||
#elif defined(BOOST_REGEX_USE_CPP_LOCALE)
|
||||
|
||||
template <class charT>
|
||||
class regex_traits : public cpp_regex_traits<charT>
|
||||
{
|
||||
};
|
||||
|
||||
#else
|
||||
#error No default localisation model defined
|
||||
#endif
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma option pop
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // include
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* LOCATION: see http://www.boost.org/libs/regex for documentation.
|
||||
* FILE regex_fwd.cpp
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Forward declares boost::reg_expression<> and
|
||||
@ -24,44 +24,9 @@
|
||||
#ifndef BOOST_REGEX_FWD_HPP
|
||||
#define BOOST_REGEX_FWD_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/allocator.hpp>
|
||||
|
||||
//
|
||||
// define BOOST_REGEX_NO_FWD if this
|
||||
// header doesn't work!
|
||||
//
|
||||
#ifdef BOOST_REGEX_NO_FWD
|
||||
# ifndef BOOST_RE_REGEX_HPP
|
||||
# include <boost/regex.hpp>
|
||||
# endif
|
||||
#else
|
||||
|
||||
//
|
||||
// If there isn't good enough wide character support then there will
|
||||
// be no wide character regular expressions:
|
||||
//
|
||||
#if (defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_CWCTYPE) || defined(BOOST_NO_STD_WSTRING)) && !defined(BOOST_NO_WREGEX)
|
||||
# define BOOST_NO_WREGEX
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
|
||||
template <class charT>
|
||||
class regex_traits;
|
||||
|
||||
template <class charT, class traits = regex_traits<charT>, class Allocator = BOOST_DEFAULT_ALLOCATOR(charT) >
|
||||
class reg_expression;
|
||||
|
||||
typedef reg_expression<char, regex_traits<char>, BOOST_DEFAULT_ALLOCATOR(char) > regex;
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
typedef reg_expression<wchar_t, regex_traits<wchar_t>, BOOST_DEFAULT_ALLOCATOR(wchar_t) > wregex;
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_REGEX_NO_FWD
|
||||
#include <boost/regex/v3/regex_fwd.hpp>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
#ifndef BOOST_FILEITER_H
|
||||
#define BOOST_FILEITER_H
|
||||
|
||||
#include <boost/regex/detail/fileiter.hpp>
|
||||
#include <boost/regex/v3/fileiter.hpp>
|
||||
|
||||
using boost::re_detail::directory_iterator;
|
||||
using boost::re_detail::file_iterator;
|
||||
|
@ -68,16 +68,7 @@ public:
|
||||
template <class iterator, class Allocator, class charT, class traits, class Allocator2>
|
||||
bool query_match(iterator first, iterator last, boost::match_results<iterator, Allocator>& m, const reg_expression<charT, traits, Allocator2>& e, unsigned flags = match_default)
|
||||
{
|
||||
// prepare m for failure:
|
||||
if((flags & match_init) == 0)
|
||||
{
|
||||
m.set_size(e.mark_count(), first, last);
|
||||
m.set_base(first);
|
||||
m.set_line(1, first);
|
||||
}
|
||||
boost::re_detail::_priv_match_data<iterator, Allocator> pd(m);
|
||||
iterator restart;
|
||||
return boost::re_detail::query_match_aux(first, last, m, e, flags, pd, &restart);
|
||||
return regex_search(first, last, m, e, flags | match_continuous);
|
||||
}
|
||||
|
||||
//
|
||||
@ -144,13 +135,7 @@ inline bool query_match(const std::basic_string<wchar_t>& s,
|
||||
template <class iterator, class Allocator, class charT, class traits, class Allocator2>
|
||||
bool reg_search(iterator first, iterator last, boost::match_results<iterator, Allocator>& m, const reg_expression<charT, traits, Allocator2>& e, unsigned flags = match_default)
|
||||
{
|
||||
if(e.flags() & regbase::failbit)
|
||||
return false;
|
||||
|
||||
typedef typename traits::size_type traits_size_type;
|
||||
typedef typename traits::uchar_type traits_uchar_type;
|
||||
|
||||
return boost::re_detail::reg_grep2(boost::re_detail::grep_search_predicate<iterator, Allocator>(&m), first, last, e, flags, m.allocator());
|
||||
return boost::regex_search(first, last, m, e, flags);
|
||||
}
|
||||
|
||||
//
|
||||
@ -226,7 +211,7 @@ inline bool reg_search(const std::basic_string<wchar_t>& s,
|
||||
template <class Predicate, class iterator, class charT, class traits, class Allocator>
|
||||
inline unsigned int reg_grep(Predicate foo, iterator first, iterator last, const reg_expression<charT, traits, Allocator>& e, unsigned flags = match_default)
|
||||
{
|
||||
return boost::re_detail::reg_grep2(foo, first, last, e, flags, e.allocator());
|
||||
return boost::regex_grep(foo, first, last, e, flags);
|
||||
}
|
||||
|
||||
//
|
||||
@ -345,7 +330,7 @@ struct grep_adaptor
|
||||
template <class Out, class iterator, class charT, class traits, class Allocator>
|
||||
inline unsigned int reg_grep_old(Out oi, iterator first, iterator last, const reg_expression<charT, traits, Allocator>& e, unsigned flags = match_default)
|
||||
{
|
||||
return boost::re_detail::reg_grep2(re_detail::grep_adaptor<Out, iterator, Allocator>(oi, e.allocator()), first, last, e, flags, e.allocator());
|
||||
return boost::regex_grep(re_detail::grep_adaptor<Out, iterator, Allocator>(oi, e.allocator()), first, last, e, flags);
|
||||
}
|
||||
|
||||
template <class OutputIterator, class iterator, class Allocator, class charT>
|
||||
@ -407,9 +392,9 @@ using deprecated::reg_search;
|
||||
using deprecated::reg_grep;
|
||||
using deprecated::reg_format;
|
||||
using deprecated::reg_merge;
|
||||
using re_detail::jm_def_alloc;
|
||||
//using re_detail::jm_def_alloc;
|
||||
using deprecated::char_regex_traits_i;
|
||||
using re_detail::re_alloc_binder;
|
||||
//using re_detail::re_alloc_binder;
|
||||
using re_detail::padding_size;
|
||||
|
||||
|
||||
@ -440,7 +425,7 @@ using boost::deprecated::reg_search;
|
||||
using boost::deprecated::reg_grep;
|
||||
using boost::deprecated::reg_format;
|
||||
using boost::deprecated::reg_merge;
|
||||
using boost::re_detail::jm_def_alloc;
|
||||
//using boost::re_detail::jm_def_alloc;
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,3 +1,18 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1998-2000
|
||||
* Dr John Maddock
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Dr John Maddock makes no representations
|
||||
* about the suitability of this software for any purpose.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
@ -1,3 +1,18 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1998-2000
|
||||
* Dr John Maddock
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Dr John Maddock makes no representations
|
||||
* about the suitability of this software for any purpose.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <regex>
|
||||
|
@ -1,3 +1,18 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1998-2000
|
||||
* Dr John Maddock
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Dr John Maddock makes no representations
|
||||
* about the suitability of this software for any purpose.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <regex>
|
||||
|
@ -1,3 +1,18 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1998-2000
|
||||
* Dr John Maddock
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Dr John Maddock makes no representations
|
||||
* about the suitability of this software for any purpose.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
@ -1,3 +1,18 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1998-2000
|
||||
* Dr John Maddock
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Dr John Maddock makes no representations
|
||||
* about the suitability of this software for any purpose.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <regex>
|
||||
|
@ -1,3 +1,18 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1998-2000
|
||||
* Dr John Maddock
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Dr John Maddock makes no representations
|
||||
* about the suitability of this software for any purpose.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <regex>
|
||||
|
@ -1,3 +1,18 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1998-2000
|
||||
* Dr John Maddock
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Dr John Maddock makes no representations
|
||||
* about the suitability of this software for any purpose.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <regex>
|
||||
|
@ -35,8 +35,8 @@
|
||||
#include <cstdio>
|
||||
#include <boost/cregex.hpp>
|
||||
#include <boost/regex/regex_traits.hpp>
|
||||
#include <boost/regex/detail/regex_synch.hpp>
|
||||
#include <boost/regex/detail/regex_cstring.hpp>
|
||||
#include <boost/regex/v3/regex_synch.hpp>
|
||||
#include <boost/regex/v3/regex_cstring.hpp>
|
||||
#include <boost/scoped_array.hpp>
|
||||
|
||||
#include "primary_transform.hpp"
|
||||
@ -54,6 +54,17 @@ void c_regex_adopted_no_longer_needed_loop_shutter_upper() { }
|
||||
|
||||
namespace{
|
||||
|
||||
//
|
||||
// helper function to get the locale name,
|
||||
// works around possibly broken setlocale implementations:
|
||||
//
|
||||
const char* getlocale(int id)
|
||||
{
|
||||
static const char* def = "Unknown";
|
||||
const char* pl = std::setlocale(id, 0);
|
||||
return pl ? pl : def;
|
||||
}
|
||||
|
||||
//
|
||||
// character classes:
|
||||
//
|
||||
@ -237,9 +248,9 @@ void BOOST_REGEX_CALL re_free_classes()
|
||||
void BOOST_REGEX_CALL re_update_classes()
|
||||
{
|
||||
BOOST_RE_GUARD_STACK
|
||||
if(*re_cls_name != std::setlocale(LC_CTYPE, 0))
|
||||
if(*re_cls_name != getlocale(LC_CTYPE))
|
||||
{
|
||||
*re_cls_name = std::setlocale(LC_CTYPE, 0);
|
||||
*re_cls_name = getlocale(LC_CTYPE);
|
||||
char buf[256];
|
||||
unsigned int i;
|
||||
for(i = 0; i < re_classes_max; ++i)
|
||||
@ -286,9 +297,9 @@ void BOOST_REGEX_CALL re_free_collate()
|
||||
void BOOST_REGEX_CALL re_update_collate()
|
||||
{
|
||||
BOOST_RE_GUARD_STACK
|
||||
if(*re_coll_name != std::setlocale(LC_COLLATE, 0))
|
||||
if(*re_coll_name != getlocale(LC_COLLATE))
|
||||
{
|
||||
*re_coll_name = std::setlocale(LC_COLLATE, 0);
|
||||
*re_coll_name = getlocale(LC_COLLATE);
|
||||
char buf[256];
|
||||
unsigned int i = 400;
|
||||
re_get_message(buf, 256, i);
|
||||
@ -350,7 +361,7 @@ void BOOST_REGEX_CALL re_message_update()
|
||||
//
|
||||
// called whenever the global locale changes:
|
||||
//
|
||||
std::string l(std::setlocale(LC_MESSAGES, 0));
|
||||
std::string l(getlocale(LC_MESSAGES));
|
||||
if(*mess_locale != l)
|
||||
{
|
||||
*mess_locale = l;
|
||||
@ -503,9 +514,9 @@ void BOOST_REGEX_CALL c_traits_base::do_update_ctype()
|
||||
if(std::isxdigit(i))
|
||||
class_map[i] |= char_class_xdigit;
|
||||
}
|
||||
class_map['_'] |= char_class_underscore;
|
||||
class_map[' '] |= char_class_blank;
|
||||
class_map['\t'] |= char_class_blank;
|
||||
class_map[(unsigned char)'_'] |= char_class_underscore;
|
||||
class_map[(unsigned char)' '] |= char_class_blank;
|
||||
class_map[(unsigned char)'\t'] |= char_class_blank;
|
||||
for(i = 0; i < map_size; ++i)
|
||||
{
|
||||
lower_case_map[i] = (char)std::tolower(i);
|
||||
@ -641,15 +652,15 @@ void BOOST_REGEX_CALL c_regex_traits<char>::update()
|
||||
re_detail::cs_guard g(*re_detail::p_re_lock);
|
||||
#endif
|
||||
re_message_update();
|
||||
if(*collate_name != std::setlocale(LC_COLLATE, 0))
|
||||
if(*collate_name != getlocale(LC_COLLATE))
|
||||
{
|
||||
do_update_collate();
|
||||
*collate_name = std::setlocale(LC_COLLATE, 0);
|
||||
*collate_name = getlocale(LC_COLLATE);
|
||||
}
|
||||
if(*ctype_name != std::setlocale(LC_CTYPE, 0))
|
||||
if(*ctype_name != getlocale(LC_CTYPE))
|
||||
{
|
||||
do_update_ctype();
|
||||
*ctype_name = std::setlocale(LC_CTYPE, 0);
|
||||
*ctype_name = getlocale(LC_CTYPE);
|
||||
}
|
||||
sort_type = re_detail::find_sort_syntax(&i, &sort_delim);
|
||||
}
|
||||
@ -838,7 +849,7 @@ void BOOST_REGEX_CALL c_regex_traits<wchar_t>::update()
|
||||
re_message_update();
|
||||
re_update_classes();
|
||||
re_update_collate();
|
||||
std::string l(std::setlocale(LC_CTYPE, 0));
|
||||
std::string l(getlocale(LC_CTYPE));
|
||||
if(*wlocale_name != l)
|
||||
{
|
||||
*wlocale_name = l;
|
||||
@ -1059,3 +1070,4 @@ std::size_t BOOST_REGEX_CALL c_regex_traits<wchar_t>::strwiden(wchar_t *s1, std:
|
||||
} // namespace boost
|
||||
|
||||
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <list>
|
||||
#include <cctype>
|
||||
#include <boost/regex/regex_traits.hpp>
|
||||
#include <boost/regex/detail/regex_synch.hpp>
|
||||
#include <boost/regex/v3/regex_synch.hpp>
|
||||
|
||||
|
||||
namespace boost{
|
||||
@ -554,3 +554,4 @@ BOOST_REGEX_DECL wchar_t wide_lower_case_map[] = {
|
||||
} // namespace re_detail
|
||||
} // namespace boost
|
||||
|
||||
|
||||
|
@ -241,7 +241,7 @@ message_data<char>::message_data(const std::locale& l, const std::string& regex_
|
||||
#endif
|
||||
for(std::size_t j = 0; j < s.size(); ++j)
|
||||
{
|
||||
syntax_map[s[j]] = (unsigned char)(i);
|
||||
syntax_map[(unsigned char)s[j]] = (unsigned char)(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
#if !defined(BOOST_NO_STD_STRING)
|
||||
#include <map>
|
||||
#include <list>
|
||||
#include <boost/regex/detail/fileiter.hpp>
|
||||
#include <boost/regex/v3/fileiter.hpp>
|
||||
#include <cstdio>
|
||||
|
||||
namespace boost{
|
||||
@ -655,3 +655,4 @@ basic_string<char>::replace<const char*>(char* f1, char* f2, const char* i1, con
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
#include <climits>
|
||||
#include <stdexcept>
|
||||
#include <boost/regex/detail/fileiter.hpp>
|
||||
#include <boost/regex/v3/fileiter.hpp>
|
||||
|
||||
#ifndef BOOST_REGEX_NO_FILEITER
|
||||
|
||||
@ -900,3 +900,4 @@ bool _fi_FindClose(_fi_find_handle dat)
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include <crtdbg.h>
|
||||
#endif
|
||||
|
||||
#include <boost/regex/detail/regex_raw_buffer.hpp>
|
||||
#include <boost/regex/v3/regex_raw_buffer.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
#ifndef BOOST_RE_OLD_IOSTREAM
|
||||
@ -216,3 +216,4 @@ debug_guard::~debug_guard()
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
#define BOOST_REGEX_SOURCE
|
||||
|
||||
#include <boost/regex/detail/regex_synch.hpp>
|
||||
#include <boost/regex/v3/regex_synch.hpp>
|
||||
|
||||
namespace boost{
|
||||
namespace re_detail{
|
||||
@ -67,3 +67,4 @@ BOOST_REGEX_DECL unsigned int re_lock_count = 0;
|
||||
} // namespace boost
|
||||
|
||||
|
||||
|
||||
|
@ -27,13 +27,13 @@
|
||||
#include <list>
|
||||
#include <cctype>
|
||||
#include <cstdio>
|
||||
#include <boost/cregex.hpp>
|
||||
#include <boost/regex/regex_traits.hpp>
|
||||
#include <boost/regex/detail/regex_synch.hpp>
|
||||
#include <boost/regex/detail/regex_cstring.hpp>
|
||||
#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
|
||||
#include <boost/cregex.hpp>
|
||||
#include <boost/regex/v3/regex_synch.hpp>
|
||||
#include <boost/regex/v3/regex_cstring.hpp>
|
||||
#include <boost/scoped_array.hpp>
|
||||
|
||||
#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
|
||||
|
||||
//
|
||||
// VC6 needs to link to user32.lib, as do all compilers that
|
||||
@ -1101,3 +1101,4 @@ unsigned short w32_regex_traits<wchar_t>::wide_unicode_classes[] = {
|
||||
|
||||
|
||||
|
||||
|
||||
|
128
test/Jamfile
128
test/Jamfile
@ -1,88 +1,64 @@
|
||||
subproject libs/regex/test ;
|
||||
|
||||
local test-dir = $(BOOST_ROOT)$(SLASH)libs$(SLASH)regex$(SLASH)test$(SLASH)regress$(SLASH) ;
|
||||
# bring in the rules for testing
|
||||
SEARCH on testing.jam = $(BOOST_BUILD_PATH) ;
|
||||
include testing.jam ;
|
||||
|
||||
local test-files = $(test-dir)tests.txt
|
||||
# dwa -- not sure if this is generally applicable
|
||||
# $(test-dir)test1252.txt
|
||||
template test
|
||||
: <lib>../build/boost_regex # sources
|
||||
: <define>BOOST_REGEX_NO_LIB=1 # requirements
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
<threading>multi
|
||||
std::facet-support
|
||||
;
|
||||
|
||||
template regression
|
||||
: <template>test # sources
|
||||
regress/parse.cpp
|
||||
regress/regress.cpp
|
||||
regress/tests.cpp
|
||||
<lib>../../test/build/boost_prg_exec_monitor
|
||||
;
|
||||
|
||||
unit-test regress : regress/parse.cpp regress/regress.cpp regress/tests.cpp
|
||||
<lib>../build/boost_regex$(SUFLIB) <lib>../../test/build/prg_exec_monitor
|
||||
:
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
:
|
||||
debug
|
||||
:
|
||||
$(test-files)
|
||||
;
|
||||
|
||||
unit-test wregress : regress/parse.cpp regress/regress.cpp regress/tests.cpp
|
||||
<lib>../build/boost_regex$(SUFLIB) <lib>../../test/build/prg_exec_monitor
|
||||
:
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>TEST_UNICODE=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
:
|
||||
debug
|
||||
:
|
||||
$(test-files)
|
||||
;
|
||||
|
||||
unit-test posix_api_check_c : c_compiler_checks/posix_api_check.c
|
||||
<lib>../build/boost_regex$(SUFLIB) <lib>../../test/build/prg_exec_monitor
|
||||
:
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
:
|
||||
debug
|
||||
:
|
||||
;
|
||||
|
||||
unit-test wide_posix_api_check_c : c_compiler_checks/wide_posix_api_check.c
|
||||
<lib>../build/boost_regex$(SUFLIB) <lib>../../test/build/prg_exec_monitor
|
||||
:
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
:
|
||||
debug
|
||||
:
|
||||
;
|
||||
|
||||
unit-test posix_api_check : c_compiler_checks/posix_api_check.cpp
|
||||
<lib>../build/boost_regex$(SUFLIB) <lib>../../test/build/prg_exec_monitor
|
||||
:
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
:
|
||||
debug
|
||||
:
|
||||
;
|
||||
|
||||
unit-test wide_posix_api_check : c_compiler_checks/wide_posix_api_check.cpp
|
||||
<lib>../build/boost_regex$(SUFLIB) <lib>../../test/build/prg_exec_monitor
|
||||
:
|
||||
<sysinclude>../../../
|
||||
<define>BOOST_REGEX_NO_LIB=1
|
||||
<define>BOOST_REGEX_STATIC_LINK=1
|
||||
:
|
||||
debug
|
||||
:
|
||||
;
|
||||
|
||||
|
||||
|
||||
|
||||
rule regex-test ( name : sources + : requirements * : input-files * )
|
||||
{
|
||||
return [ run $(sources) : : $(input-files) : $(requirements) : $(name) ] ;
|
||||
}
|
||||
|
||||
test-suite regex
|
||||
:
|
||||
[ regex-test regress
|
||||
: <template>regression # sources
|
||||
: # requirements
|
||||
: regress/tests.txt # input files
|
||||
]
|
||||
|
||||
[ regex-test wregress
|
||||
: <template>regression # sources
|
||||
: <define>TEST_UNICODE=1 # requirements
|
||||
: regress/tests.txt # input files
|
||||
]
|
||||
|
||||
[ regex-test posix_api_check_c
|
||||
: <template>test # sources
|
||||
c_compiler_checks/posix_api_check.c
|
||||
]
|
||||
|
||||
[ regex-test wide_posix_api_check_c
|
||||
: <template>test # sources
|
||||
c_compiler_checks/wide_posix_api_check.c
|
||||
]
|
||||
|
||||
[ regex-test posix_api_check
|
||||
: <template>test # sources
|
||||
c_compiler_checks/posix_api_check.cpp
|
||||
]
|
||||
|
||||
[ regex-test wide_posix_api_check
|
||||
: <template>test # sources
|
||||
c_compiler_checks/wide_posix_api_check.cpp
|
||||
]
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
@ -44,27 +44,40 @@ int main()
|
||||
{
|
||||
regex_t re;
|
||||
int result;
|
||||
wchar_t buf[256];
|
||||
char nbuf[256];
|
||||
int i;
|
||||
result = regcomp(&re, expression, REG_AWK);
|
||||
if(result > REG_NOERROR)
|
||||
{
|
||||
wchar_t buf[256];
|
||||
regerror(result, &re, buf, sizeof(buf));
|
||||
wprintf(buf);
|
||||
for(i = 0; i < 256; ++i)
|
||||
nbuf[i] = buf[i];
|
||||
printf(nbuf);
|
||||
return result;
|
||||
}
|
||||
assert(re.re_nsub == 0);
|
||||
if(re.re_nsub != 0)
|
||||
{
|
||||
regfree(&re);
|
||||
exit(-1);
|
||||
}
|
||||
matches[0].rm_so = 0;
|
||||
matches[0].rm_eo = wcslen(text);
|
||||
result = regexec(&re, text, 1, matches, REG_NOTBOL | REG_NOTEOL | REG_STARTEND);
|
||||
if(result > REG_NOERROR)
|
||||
{
|
||||
wchar_t buf[256];
|
||||
regerror(result, &re, buf, sizeof(buf));
|
||||
wprintf(buf);
|
||||
for(i = 0; i < 256; ++i)
|
||||
nbuf[i] = buf[i];
|
||||
printf(nbuf);
|
||||
regfree(&re);
|
||||
return result;
|
||||
}
|
||||
assert(matches[0].rm_so == matches[0].rm_eo == 1);
|
||||
if((matches[0].rm_so != matches[0].rm_eo) || (matches[0].rm_eo != 1))
|
||||
{
|
||||
regfree(&re);
|
||||
exit(-1);
|
||||
}
|
||||
regfree(&re);
|
||||
printf("no errors found\n");
|
||||
return 0;
|
||||
@ -74,3 +87,5 @@ int main()
|
||||
# error "This library has not been configured for wide character support"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
@ -49,10 +49,17 @@ int main()
|
||||
{
|
||||
wchar_t buf[256];
|
||||
regerror(result, &re, buf, sizeof(buf));
|
||||
wprintf(buf);
|
||||
char nbuf[256];
|
||||
for(int i = 0; i < 256; ++i)
|
||||
nbuf[i] = buf[i];
|
||||
printf(nbuf);
|
||||
return result;
|
||||
}
|
||||
assert(re.re_nsub == 0);
|
||||
if(re.re_nsub != 0)
|
||||
{
|
||||
regfree(&re);
|
||||
exit(-1);
|
||||
}
|
||||
matches[0].rm_so = 0;
|
||||
matches[0].rm_eo = wcslen(text);
|
||||
result = regexec(&re, text, 1, matches, REG_NOTBOL | REG_NOTEOL | REG_STARTEND);
|
||||
@ -60,11 +67,18 @@ int main()
|
||||
{
|
||||
wchar_t buf[256];
|
||||
regerror(result, &re, buf, sizeof(buf));
|
||||
wprintf(buf);
|
||||
char nbuf[256];
|
||||
for(int i = 0; i < 256; ++i)
|
||||
nbuf[i] = buf[i];
|
||||
printf(nbuf);
|
||||
regfree(&re);
|
||||
return result;
|
||||
}
|
||||
assert(matches[0].rm_so == matches[0].rm_eo == 1);
|
||||
if((matches[0].rm_so != matches[0].rm_eo) || (matches[0].rm_eo != 1))
|
||||
{
|
||||
regfree(&re);
|
||||
exit(-1);
|
||||
}
|
||||
regfree(&re);
|
||||
printf("no errors found\n");
|
||||
return 0;
|
||||
@ -75,3 +89,4 @@ int main()
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user