mirror of
https://github.com/boostorg/regex.git
synced 2025-07-23 09:07:25 +02:00
Merge branch 'develop' into staticptrfix
This commit is contained in:
29
.travis.yml
29
.travis.yml
@ -27,6 +27,30 @@ matrix:
|
|||||||
- env: BOGUS_JOB=true
|
- env: BOGUS_JOB=true
|
||||||
|
|
||||||
include:
|
include:
|
||||||
|
- os: linux
|
||||||
|
env: TEST_CMAKE=true # variables unused - just for identification in travis ci gui
|
||||||
|
script:
|
||||||
|
- git submodule update --init tools/cmake
|
||||||
|
- git submodule update --init libs/conversion
|
||||||
|
- git submodule update --init libs/function_types
|
||||||
|
- git submodule update --init libs/fusion
|
||||||
|
- git submodule update --init libs/typeof
|
||||||
|
- mkdir __build__ && cd __build__
|
||||||
|
- cmake .. -DBOOST_ENABLE_CMAKE=ON -DBOOST_REGEX_INCLUDE_EXAMPLES=ON
|
||||||
|
- cmake --build .
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
env: TEST_CMAKE=true BUILD_SHARED_LIBS=On # variables unused - just for identification in travis ci gui
|
||||||
|
script:
|
||||||
|
- git submodule update --init tools/cmake
|
||||||
|
- git submodule update --init libs/conversion
|
||||||
|
- git submodule update --init libs/function_types
|
||||||
|
- git submodule update --init libs/fusion
|
||||||
|
- git submodule update --init libs/typeof
|
||||||
|
- mkdir __build__ && cd __build__
|
||||||
|
- cmake .. -DBUILD_SHARED_LIBS=ON -DBOOST_ENABLE_CMAKE=ON -DBOOST_REGEX_INCLUDE_EXAMPLES=ON
|
||||||
|
- cmake --build .
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
env: TOOLSET=gcc COMPILER=g++ CXXSTD=03
|
env: TOOLSET=gcc COMPILER=g++ CXXSTD=03
|
||||||
|
|
||||||
@ -242,9 +266,12 @@ matrix:
|
|||||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11
|
||||||
osx_image: xcode6.4
|
osx_image: xcode6.4
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
|
||||||
- cd ..
|
- cd ..
|
||||||
- git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
- git clone -b $BOOST_BRANCH https://github.com/boostorg/boost.git boost-root
|
||||||
- cd boost-root
|
- cd boost-root
|
||||||
- git submodule update --init tools/build
|
- git submodule update --init tools/build
|
||||||
- git submodule update --init tools/boost_install
|
- git submodule update --init tools/boost_install
|
||||||
|
113
CMakeLists.txt
Normal file
113
CMakeLists.txt
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
# Copyright 2018-2019 Mike Dev
|
||||||
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
|
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
#
|
||||||
|
# NOTE: CMake support for Boost.Regex is currently experimental at best
|
||||||
|
# and the interface is likely to change in the future
|
||||||
|
|
||||||
|
|
||||||
|
##### How-To:
|
||||||
|
#
|
||||||
|
# If you have a cmake project that wants to use and compile
|
||||||
|
# boost_regex, as part of a single build system run, do the following:
|
||||||
|
# 1) clone the boost project and all its sub-projects:
|
||||||
|
#
|
||||||
|
# git clone --branch develop --depth 1 --recursive --shallow-submodules https://github.com/boostorg/boost.git boost-root
|
||||||
|
#
|
||||||
|
# 2) add to your cmake script:
|
||||||
|
#
|
||||||
|
# add_subdirectory( <path-to-boost-root> [<build-dir-for-boost-libs>])
|
||||||
|
# target_link_libraries( <my-exec> PUBLIC Boost::regex)
|
||||||
|
#
|
||||||
|
# 3) run your cmake build as usual
|
||||||
|
#
|
||||||
|
# ## Explanation:
|
||||||
|
#
|
||||||
|
# Currently this file does not work standalone. It is expected to be
|
||||||
|
# invoked from a parent script via add_subdirectory. That parent script
|
||||||
|
# is responsible for providing targets for direct and indirect dependencies,
|
||||||
|
# such as Boost::assert, Boost::concept_check, e.g. by also adding those
|
||||||
|
# libraries via add_submodule (order doesn't matter).
|
||||||
|
# The parent script can be your own cmake script, but it is easier to just
|
||||||
|
# use add the CMakeLists in the root of the boost super project, which
|
||||||
|
# will in turn add all boost libraries usable with the add_subdirectory
|
||||||
|
# Workflow.
|
||||||
|
#
|
||||||
|
# Note: You don't need to actually clone all boost libraries. E.g. look
|
||||||
|
# into the travis ci file to see on which libraries boost_regex actually
|
||||||
|
# depends or use boostdep https://github.com/boostorg/boostdep
|
||||||
|
|
||||||
|
|
||||||
|
##### Current Limitations:
|
||||||
|
#
|
||||||
|
# - Doesn't compile or run tests
|
||||||
|
# - Doesn't support installation
|
||||||
|
#
|
||||||
|
|
||||||
|
cmake_minimum_required( VERSION 3.5 )
|
||||||
|
project( BoostRegex LANGUAGES CXX )
|
||||||
|
|
||||||
|
option( BOOST_REGEX_INCLUDE_EXAMPLES "Also build (some) boost regex examples" OFF )
|
||||||
|
option( BOOST_REGEX_USE_ICU "Enable ICU support in boost regex" OFF )
|
||||||
|
|
||||||
|
file( GLOB BOOST_REGEX_SRC ./src/*.cpp )
|
||||||
|
|
||||||
|
add_library( boost_regex ${BOOST_REGEX_SRC} )
|
||||||
|
add_library( Boost::regex ALIAS boost_regex )
|
||||||
|
|
||||||
|
# Currently, installation isn't supported directly,
|
||||||
|
# but someone else might install this target from the parent
|
||||||
|
# CMake script, so lets proactively differentiate between
|
||||||
|
# the include directory during regular use (BUILD_INTERFACE)
|
||||||
|
# and after installation
|
||||||
|
target_include_directories( boost_regex
|
||||||
|
PUBLIC
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
|
$<INSTALL_INTERFACE:include>
|
||||||
|
)
|
||||||
|
|
||||||
|
target_compile_definitions( boost_regex
|
||||||
|
PUBLIC
|
||||||
|
# No need for autolink and we don't mangle library name anyway
|
||||||
|
BOOST_REGEX_NO_LIB
|
||||||
|
$<$<STREQUAL:$<TARGET_PROPERTY:boost_regex,TYPE>,SHARED_LIBRARY>:BOOST_REGEX_DYN_LINK=1>
|
||||||
|
$<$<STREQUAL:$<TARGET_PROPERTY:boost_regex,TYPE>,STATIC_LIBRARY>:BOOST_REGEX_STATIC_LINK=1>
|
||||||
|
)
|
||||||
|
|
||||||
|
# Specify dependencies (including header-only libraries)
|
||||||
|
target_link_libraries( boost_regex
|
||||||
|
PUBLIC
|
||||||
|
Boost::assert
|
||||||
|
Boost::concept_check
|
||||||
|
Boost::config
|
||||||
|
Boost::container_hash
|
||||||
|
Boost::core
|
||||||
|
Boost::integer
|
||||||
|
Boost::iterator
|
||||||
|
Boost::mpl
|
||||||
|
Boost::predef
|
||||||
|
Boost::smart_ptr
|
||||||
|
Boost::static_assert
|
||||||
|
Boost::throw_exception
|
||||||
|
Boost::type_traits
|
||||||
|
)
|
||||||
|
|
||||||
|
if( BOOST_REGEX_USE_ICU )
|
||||||
|
# ICU Targets could be provided by parent project,
|
||||||
|
# if not, look for them ourselves
|
||||||
|
if( NOT TARGET ICU::dt )
|
||||||
|
# components need to be listed explicitly
|
||||||
|
find_package( ICU COMPONENTS dt in uc REQUIRED )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries( boost_regex
|
||||||
|
PRIVATE
|
||||||
|
ICU::dt ICU::in ICU::uc
|
||||||
|
)
|
||||||
|
target_compile_definitions( boost_regex PRIVATE BOOST_HAS_ICU=1 )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if( BOOST_REGEX_INCLUDE_EXAMPLES )
|
||||||
|
add_subdirectory( example/snippets )
|
||||||
|
endif()
|
||||||
|
|
@ -8,12 +8,11 @@
|
|||||||
|
|
||||||
[section:history History]
|
[section:history History]
|
||||||
|
|
||||||
New issues should be submitted at [@http://svn.boost.org svn.boost.org] - don't forget to include your
|
New issues should be submitted at [@https://github.com/boostorg/regex/issues https://github.com/boostorg/regex/issues]
|
||||||
email address in the ticket!
|
|
||||||
|
|
||||||
Currently open issues can be viewed [@https://svn.boost.org/trac/boost/query?status=assigned&status=new&status=reopened&component=regex&order=priority&col=id&col=summary&col=status&col=type&col=milestone&col=component here].
|
Currently open issues can be viewed [@https://github.com/boostorg/regex/issues?q=is%3Aopen+is%3Aissue here].
|
||||||
|
|
||||||
All issues including closed ones can be viewed [@https://svn.boost.org/trac/boost/query?status=assigned&status=closed&status=new&status=reopened&component=regex&order=priority&col=id&col=summary&col=status&col=type&col=milestone&col=component here].
|
All issues including closed ones can be viewed [@https://github.com/boostorg/regex/issues?q=is%3Aissue+is%3Aclosed here].
|
||||||
|
|
||||||
[h4 Boost.Regex-5.1.4 (Boost-172.0)]
|
[h4 Boost.Regex-5.1.4 (Boost-172.0)]
|
||||||
|
|
||||||
|
30
example/snippets/CMakeLists.txt
Normal file
30
example/snippets/CMakeLists.txt
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# Copyright 2019 Mike Dev
|
||||||
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
|
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
#
|
||||||
|
# NOTE: CMake support for Boost.Regex is currently experimental at best
|
||||||
|
# and we are currently only building a few examples
|
||||||
|
|
||||||
|
set(examples
|
||||||
|
partial_regex_grep
|
||||||
|
partial_regex_iterate
|
||||||
|
partial_regex_match
|
||||||
|
regex_grep_example_1
|
||||||
|
regex_grep_example_2
|
||||||
|
regex_grep_example_3
|
||||||
|
regex_grep_example_4
|
||||||
|
regex_iterator_example
|
||||||
|
regex_match_example
|
||||||
|
regex_merge_example
|
||||||
|
regex_replace_example
|
||||||
|
regex_search_example
|
||||||
|
regex_split_example_1
|
||||||
|
regex_split_example_2
|
||||||
|
regex_token_iterator_eg_1
|
||||||
|
regex_token_iterator_eg_2
|
||||||
|
)
|
||||||
|
|
||||||
|
foreach( example IN LISTS examples )
|
||||||
|
add_executable( boost_regex_ex_${example} ${example}.cpp )
|
||||||
|
target_link_libraries( boost_regex_ex_${example} Boost::regex )
|
||||||
|
endforeach()
|
@ -50,6 +50,8 @@ class regex_iterator_implementation
|
|||||||
public:
|
public:
|
||||||
regex_iterator_implementation(const regex_type* p, BidirectionalIterator last, match_flag_type f)
|
regex_iterator_implementation(const regex_type* p, BidirectionalIterator last, match_flag_type f)
|
||||||
: base(), end(last), re(*p), flags(f){}
|
: base(), end(last), re(*p), flags(f){}
|
||||||
|
regex_iterator_implementation(const regex_iterator_implementation& other)
|
||||||
|
:what(other.what), base(other.base), end(other.end), re(other.re), flags(other.flags){}
|
||||||
bool init(BidirectionalIterator first)
|
bool init(BidirectionalIterator first)
|
||||||
{
|
{
|
||||||
base = first;
|
base = first;
|
||||||
|
@ -141,7 +141,7 @@ inline bool is_separator<char>(char c)
|
|||||||
BOOST_REGEX_DECL std::string BOOST_REGEX_CALL lookup_default_collate_name(const std::string& name);
|
BOOST_REGEX_DECL std::string BOOST_REGEX_CALL lookup_default_collate_name(const std::string& name);
|
||||||
|
|
||||||
//
|
//
|
||||||
// get the state_id of a character clasification, the individual
|
// get the state_id of a character classification, the individual
|
||||||
// traits classes then transform that state_id into a bitmask:
|
// traits classes then transform that state_id into a bitmask:
|
||||||
//
|
//
|
||||||
template <class charT>
|
template <class charT>
|
||||||
|
@ -193,7 +193,7 @@ BOOST_REGEX_DECL bool BOOST_REGEX_CALL is_combining_implementation(boost::uint_l
|
|||||||
//
|
//
|
||||||
// these are the POSIX collating names:
|
// these are the POSIX collating names:
|
||||||
//
|
//
|
||||||
BOOST_REGEX_DECL extern const char* const def_coll_names[] = {
|
static const char* def_coll_names[] = {
|
||||||
"NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "alert", "backspace", "tab", "newline",
|
"NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "alert", "backspace", "tab", "newline",
|
||||||
"vertical-tab", "form-feed", "carriage-return", "SO", "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK",
|
"vertical-tab", "form-feed", "carriage-return", "SO", "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK",
|
||||||
"SYN", "ETB", "CAN", "EM", "SUB", "ESC", "IS4", "IS3", "IS2", "IS1", "space", "exclamation-mark",
|
"SYN", "ETB", "CAN", "EM", "SUB", "ESC", "IS4", "IS3", "IS2", "IS1", "space", "exclamation-mark",
|
||||||
@ -214,7 +214,7 @@ BOOST_REGEX_DECL extern const char* const def_coll_names[] = {
|
|||||||
// little more - but this will have to do for
|
// little more - but this will have to do for
|
||||||
// now:
|
// now:
|
||||||
|
|
||||||
BOOST_REGEX_DECL extern const char* const def_multi_coll[] = {
|
static const char* def_multi_coll[] = {
|
||||||
"ae",
|
"ae",
|
||||||
"Ae",
|
"Ae",
|
||||||
"AE",
|
"AE",
|
||||||
|
Reference in New Issue
Block a user