File indexing completed on 2025-01-18 09:54:06
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef CATCH_REPORTER_SPEC_PARSER_HPP_INCLUDED
0009 #define CATCH_REPORTER_SPEC_PARSER_HPP_INCLUDED
0010
0011 #include <catch2/internal/catch_console_colour.hpp>
0012 #include <catch2/internal/catch_optional.hpp>
0013 #include <catch2/internal/catch_stringref.hpp>
0014
0015 #include <map>
0016 #include <string>
0017 #include <vector>
0018
0019 namespace Catch {
0020
0021 enum class ColourMode : std::uint8_t;
0022
0023 namespace Detail {
0024
0025 std::vector<std::string> splitReporterSpec( StringRef reporterSpec );
0026
0027 Optional<ColourMode> stringToColourMode( StringRef colourMode );
0028 }
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 class ReporterSpec {
0039 std::string m_name;
0040 Optional<std::string> m_outputFileName;
0041 Optional<ColourMode> m_colourMode;
0042 std::map<std::string, std::string> m_customOptions;
0043
0044 friend bool operator==( ReporterSpec const& lhs,
0045 ReporterSpec const& rhs );
0046 friend bool operator!=( ReporterSpec const& lhs,
0047 ReporterSpec const& rhs ) {
0048 return !( lhs == rhs );
0049 }
0050
0051 public:
0052 ReporterSpec(
0053 std::string name,
0054 Optional<std::string> outputFileName,
0055 Optional<ColourMode> colourMode,
0056 std::map<std::string, std::string> customOptions );
0057
0058 std::string const& name() const { return m_name; }
0059
0060 Optional<std::string> const& outputFile() const {
0061 return m_outputFileName;
0062 }
0063
0064 Optional<ColourMode> const& colourMode() const { return m_colourMode; }
0065
0066 std::map<std::string, std::string> const& customOptions() const {
0067 return m_customOptions;
0068 }
0069 };
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081 Optional<ReporterSpec> parseReporterSpec( StringRef reporterSpec );
0082
0083 }
0084
0085 #endif