diff --git a/CMakeLists.txt b/CMakeLists.txt index 0445a82..54e81fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,6 @@ option(UPA_BUILD_BENCH "Build the Upa URL benchmarks." OFF) option(UPA_BUILD_FUZZER "Build the Upa URL fuzzer." OFF) option(UPA_BUILD_EXAMPLES "Build the Upa URL examples." OFF) option(UPA_BUILD_EXTRACTED "Build Upa URL examples extracted from the docs." OFF) -option(UPA_BUILD_TOOLS "Build tools." OFF) option(UPA_INSTALL "Generate the install target." ON) # library options option(UPA_AMALGAMATED "Use amalgamated URL library source." OFF) @@ -113,7 +112,7 @@ include_directories(deps) # Is the Upa URL library needed? if (UPA_BUILD_TESTS OR UPA_BUILD_BENCH OR UPA_BUILD_FUZZER OR UPA_BUILD_EXAMPLES OR - UPA_BUILD_EXTRACTED OR UPA_INSTALL OR NOT UPA_BUILD_TOOLS) + UPA_BUILD_EXTRACTED OR UPA_INSTALL) if (UPA_AMALGAMATED) add_library(${upa_lib_target} STATIC single_include/upa/url.cpp) @@ -224,14 +223,6 @@ if (UPA_BUILD_EXTRACTED) add_subdirectory(examples/extracted-cpp) endif() -# Tool's targets - -if (UPA_BUILD_TOOLS) - add_executable(dumpCharBitSets tools/dumpCharBitSets.cpp) - set_property(TARGET dumpCharBitSets PROPERTY CXX_STANDARD 17) - target_include_directories(dumpCharBitSets PRIVATE include) -endif() - # Install if (UPA_INSTALL AND NOT UPA_AMALGAMATED) diff --git a/tools/dumpCharBitSets.cpp b/tools/dumpCharBitSets.cpp deleted file mode 100644 index e6db445..0000000 --- a/tools/dumpCharBitSets.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2019-2023 Rimas Misevičius -// Distributed under the BSD-style license that can be -// found in the LICENSE file. -// - -#include "upa/url_percent_encode.h" -#include -#include - -#ifndef UPA_CPP_17 -#error "This file requires C++17 compiler" -#endif - -using namespace upa; - -template -void dumpSet(std::ostream& out, const char* type, const char* name, const CodePointSet& cpset) { - out << std::setfill('0') << std::hex; - - out << "const " << type << " " << name << " = {\n "; - // find last non-zero value in array - std::size_t size = cpset.arr_size(); - while (size > 0 && cpset.arr_val(size - 1) == 0) - --size; - // output array values - for (std::size_t i = 0; i < size; ++i) { - if (i > 0) out << ((i % 16) == 0 ? ",\n " : ", "); - out << "0x" << std::setw(2) << unsigned(cpset.arr_val(i)); - } - out << "\n};\n"; -} - -#define DUMP_SET(type, name) dumpSet(out, #type, #name, name) - -void dumpAll(std::ostream& out) { - out << "// These data were generated by tools/dumpCharBitSets.cpp program.\n"; - - DUMP_SET(code_point_set, fragment_no_encode_set); - DUMP_SET(code_point_set, query_no_encode_set); - DUMP_SET(code_point_set, special_query_no_encode_set); - DUMP_SET(code_point_set, path_no_encode_set); - DUMP_SET(code_point_set, raw_path_no_encode_set); - DUMP_SET(code_point_set, posix_path_no_encode_set); - DUMP_SET(code_point_set, userinfo_no_encode_set); - DUMP_SET(code_point_set, component_no_encode_set); - - using namespace detail; - out << "\n" "namespace detail {\n"; - DUMP_SET(code_points_multiset, code_points); - out << "} // namespace detail\n"; -} - -int main() { - dumpAll(std::cout); - - return 0; -}