Skip to content
Snippets Groups Projects
Unverified Commit 274a7f29 authored by Yurov, Dmitry's avatar Yurov, Dmitry Committed by GitHub
Browse files

Merge pull request #561 from waltervh/develop

Remove boost::regex dependency (issue #2113)
parents c69c8290 6e820508
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@
#include "FileSystemUtils.h"
#include "Exceptions.h"
#include <boost/filesystem.hpp>
#include <boost/regex.hpp>
#include <regex>
#include <cassert>
#include <stdexcept>
......@@ -77,7 +77,7 @@ std::vector<std::string> FileSystemUtils::glob(const std::string& dir, const std
{
std::vector<std::string> ret;
for (const std::string& fname : filesInDirectory(dir))
if (boost::regex_match(fname, boost::regex(pattern)))
if (std::regex_match(fname, std::regex(pattern)))
ret.push_back(fname);
return ret;
}
......
......@@ -14,13 +14,11 @@
#include "StringUtils.h"
#include <boost/algorithm/string.hpp>
#include <boost/regex.hpp>
#include <regex>
//! Returns true if text matches pattern with wildcards '*' and '?'.
bool StringUtils::matchesPattern(const std::string& text, const std::string& wildcardPattern)
{
bool caseSensitive(true);
// escape all regex special characters, except '?' and '*'
std::string mywildcardPattern = wildcardPattern;
boost::replace_all(mywildcardPattern, "\\", "\\\\");
......@@ -41,11 +39,10 @@ bool StringUtils::matchesPattern(const std::string& text, const std::string& wil
// constructing regexp pattern
mywildcardPattern = "^" + mywildcardPattern + "$";
boost::regex pattern(mywildcardPattern,
caseSensitive ? boost::regex::normal : boost::regex::icase);
std::regex pattern(mywildcardPattern);
// applaying match
return boost::regex_match(text, pattern);
return std::regex_match(text, pattern);
}
//! Returns string right-padded with blanks.
......
......@@ -24,7 +24,7 @@ set(CPACK_DEBIAN_PACKAGE_NAME "${CPACK_PACKAGE_NAME}")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
set(CPACK_STRIP_FILES "TRUE")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libgsl2, libboost-date-time${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}, libboost-chrono${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}, libboost-python${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}, libboost-program-options${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}, libboost-iostreams${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}, libboost-regex${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}, libboost-filesystem${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}, libboost-thread${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}, libfftw3-3(>=3.3.1), python(>=2.7), libpython2.7, python-numpy, python-matplotlib, libc6(>= 2.7), libqt5widgets5(>=5.1.0), libtiffxx5(>=4.0.2)")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libgsl2, libboost-date-time${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}, libboost-chrono${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}, libboost-python${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}, libboost-program-options${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}, libboost-iostreams${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}, libboost-filesystem${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}, libboost-thread${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}, libfftw3-3(>=3.3.1), python(>=2.7), libpython2.7, python-numpy, python-matplotlib, libc6(>= 2.7), libqt5widgets5(>=5.1.0), libtiffxx5(>=4.0.2)")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}")
set(CPACK_DEBIAN_PACKAGE_VERSION ${BornAgain_VERSION_PATCH})
set(CPACK_PACKAGE_FILE_NAME "${CPACK_DEBIAN_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}-${CPACK_DEBIAN_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
......
......@@ -18,7 +18,7 @@ set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
add_definitions(-DBOOST_ALL_DYN_LINK) # line is needed for MSVC
#add_definitions(-DBOOST_LIB_DIAGNOSTIC) # shows during compilation auto-linked libraries
set(boost_libraries_required date_time chrono program_options regex iostreams system filesystem)
set(boost_libraries_required date_time chrono program_options iostreams system filesystem)
if(WIN32)
set(boost_libraries_required ${boost_libraries_required} zlib bzip2)
endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment