Coverage Report

Created: 2026-03-12 06:35

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/CMake/Source/cmSbomArguments.h
Line
Count
Source
1
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2
   file LICENSE.rst or https://cmake.org/licensing for details.  */
3
#pragma once
4
5
#include "cmConfigure.h" // IWYU pragma: keep
6
7
#include <string>
8
9
#include <cm/string_view>
10
#include <cm/type_traits>
11
#include <cmext/string_view>
12
13
#include "cmArgumentParser.h" // IWYU pragma: keep
14
#include "cmArgumentParserTypes.h"
15
#include "cmProjectInfoArguments.h"
16
17
class cmSbomArguments : public cmProjectInfoArguments
18
{
19
public:
20
  enum class SbomFormat
21
  {
22
    SPDX_3_0_JSON,
23
    NONE,
24
  };
25
26
  template <
27
    typename T,
28
    typename = cm::enable_if_t<std::is_base_of<cmSbomArguments, T>::value>>
29
  static void Bind(cmArgumentParser<T>& parser)
30
0
  {
31
0
    cmSbomArguments* const self = nullptr;
32
0
    cmSbomArguments::Bind(parser, self);
33
0
  }
34
0
  void Bind(cmArgumentParser<void>& parser) { Bind(parser, this); }
35
36
  bool Check(cmExecutionStatus& status) const override;
37
  std::string GetNamespace() const;
38
  std::string GetPackageDirName() const;
39
  std::string GetPackageFileName() const;
40
  SbomFormat GetFormat() const;
41
42
  ArgumentParser::NonEmpty<std::string> Format;
43
44
protected:
45
  cm::string_view CommandName() const override;
46
47
private:
48
  using cmProjectInfoArguments::Bind;
49
50
  template <typename T>
51
  static void Bind(cmArgumentParser<T>& parser, cmSbomArguments* self)
52
0
  {
53
0
    cmProjectInfoArguments* const base = self;
54
0
    Bind(base, parser, "SBOM"_s, &cmProjectInfoArguments::PackageName);
55
0
    Bind(self, parser, "FORMAT"_s, &cmSbomArguments::Format);
56
0
    cmProjectInfoArguments::Bind(parser, self);
57
0
  }
Unexecuted instantiation: cmExportCommand.cxx:void cmSbomArguments::Bind<HandleSpecialExportMode<cmSbomArguments, cmExportBuildSbomGenerator>(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, cmExecutionStatus&)::ExportArguments>(cmArgumentParser<HandleSpecialExportMode<cmSbomArguments, cmExportBuildSbomGenerator>(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, cmExecutionStatus&)::ExportArguments>&, cmSbomArguments*)
Unexecuted instantiation: void cmSbomArguments::Bind<void>(cmArgumentParser<void>&, cmSbomArguments*)
58
};
59
60
extern template void cmSbomArguments::Bind<void>(cmArgumentParser<void>&,
61
                                                 cmSbomArguments*);