Skip to content
Myr

Updates for older compiler/boost version

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Peter · committed by David Peter · parent 3ee77fe · Browse files · 3 files+14 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+14 added−6 removed

  • other:+14 added−6 removed

3 files+14 added−6 removed

modified:src/fnd.cpp+7 added-5 removed
16 unmodified lines
1718 std::cout << path.string();1920 std::cout << ANSI_RESET << std::endl;2121}2223void findFiles(const std::regex& pattern) {24 const fs::path& currentPath = fs::current_path();2527 for (auto& entry: fs::recursive_directory_iterator(currentPath)) {28 const fs::path& path = entry.path().lexically_relative(currentPath);26 fs::recursive_directory_iterator entry;27 for (entry = fs::recursive_directory_iterator(currentPath);28 entry != fs::recursive_directory_iterator(); ++entry) {29 const fs::path& path = entry->path();3031 if (std::regex_search(path.string(), pattern)) {32 printPath(path);33 }
15 unmodified lines
49 }5051 // try to parse the argument as a regex52 try {52 std::regex re(argument, std::regex_constants::ECMAScript53 | std::regex_constants::icase );53 std::regex::flag_type flags = std::regex_constants::ECMAScript54 | std::regex_constants::icase;55 std::regex re(argument, flags);5657 findFiles(re);58 }59 catch (const std::regex_error& e) {
6 unmodified lines
modified:CMakeLists.txt+3 added-1 removed
1cmake_minimum_required(VERSION 3.1.0)23project(fnd CXX)45find_package(Boost 1.56 REQUIRED COMPONENTS filesystem)5find_package(Boost 1.54 REQUIRED COMPONENTS system filesystem)6include_directories( ${Boost_INCLUDE_DIR} )78file(GLOB SOURCES "src/*.cpp")910set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic")1112add_executable(fnd ${SOURCES})1314target_compile_features(fnd PRIVATE cxx_range_for)1516target_link_libraries(fnd ${Boost_LIBRARIES})
modified:README.md+4 added