// Copyright (c) 2017-2026, University of Cincinnati, developed by Henry Schreiner // under NSF AWARD 1414736 and by the respective contributors. // All rights reserved. // // SPDX-License-Identifier: BSD-3-Clause #pragma once #ifdef CLI11_SINGLE_FILE #include "CLI11.hpp" #else #include "CLI/CLI.hpp" #endif #include #include #include #include #include #include #include #include namespace CLI { class intWrapper64 { public: intWrapper64() = default; explicit intWrapper64(int64_t v) : val(v) {}; CLI11_NODISCARD int64_t value() const { return val; } private: int64_t val{0}; }; class doubleWrapper { public: doubleWrapper() = default; explicit doubleWrapper(double v) : val(v) {}; CLI11_NODISCARD double value() const { return val; } private: double val{0.0}; }; class stringWrapper { public: stringWrapper() = default; explicit stringWrapper(std::string_view v) : val(v) {}; CLI11_NODISCARD std::string value() const { return val; } private: std::string val{}; }; /// @brief class for extracting data for custom subcommand generation. class SubcommandData { public: std::string name{""}; std::string description{""}; std::string modifiers{""}; std::string data{""}; std::size_t next{std::string::npos}; }; SubcommandData extract_subcomand_info(const std::string &description_string, std::size_t index); class FuzzApp { public: FuzzApp() = default; /** generate a fuzzing application with a bunch of different interfaces*/ std::shared_ptr generateApp(); /** compare two fuzz apps for equality*/ CLI11_NODISCARD bool compare(const FuzzApp &other, bool print_error = false) const; /** generate additional options based on a string config*/ std::size_t add_custom_options(CLI::App *app, const std::string &description_string); /** modify an option based on string*/ static void modify_option(CLI::Option *opt, const std::string &modifier); /** modify a subcommand based on characters in a string*/ static void modify_subcommand(CLI::App *app, const std::string &modifiers); /** return true if the app itself support conversiont to config files*/ CLI11_NODISCARD bool supports_config_file() const { return !non_config_required; } int32_t val32{0}; int16_t val16{0}; int8_t val8{0}; int64_t val64{0}; uint32_t uval32{0}; uint16_t uval16{0}; uint8_t uval8{0}; uint64_t uval64{0}; std::atomic atomicval64{0}; std::atomic atomicuval64{0}; double v1{0}; float v2{0}; std::vector vv1{}; std::vector vstr{}; std::vector> vecvecd{}; std::vector> vvs{}; std::optional od1{}; std::optional ods{}; std::optional> ovs{}; std::pair p1{}; std::pair, std::string> p2{}; std::tuple> t1{}; std::tuple>, std::string, double>, std::vector, std::optional> tcomplex{}; std::tuple>, std::string, double>, std::vector, std::optional> tcomplex2{}; std::vector>> vectup{}; std::string_view vstrv = ""; bool flag1{false}; int flagCnt{0}; std::atomic flagAtomic{false}; intWrapper64 iwrap{0}; doubleWrapper dwrap{0.0}; stringWrapper swrap{}; std::string buffer{}; std::complex cv3{0.0, 0.0}; std::complex cv4{0.0, 0.0}; int intbuffer{0}; std::atomic doubleAtomic{0.0}; // for testing restrictions and reduction methods std::vector vstrA{}; std::vector vstrB{}; std::vector vstrC{}; std::vector vstrD{}; std::vector vstrE{}; std::vector vstrF{}; std::string mergeBuffer{}; std::vector validator_strings{}; std::vector>> custom_string_options{}; std::vector, bool>>> custom_vector_options{}; private: bool non_config_required{false}; }; } // namespace CLI