CMake Nightly Date Stamp
[kiteware-cmake.git] / Source / cmSubcommandTable.h
blob80d8c6df4519dbf4caccedf572b60107921ef081
1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
3 #pragma once
5 #include "cmConfigure.h" // IWYU pragma: keep
7 #include <initializer_list>
8 #include <string>
9 #include <utility>
10 #include <vector>
12 #include <cm/string_view>
13 #include <cmext/string_view>
15 class cmExecutionStatus;
17 class cmSubcommandTable
19 public:
20 using Command = bool (*)(std::vector<std::string> const&,
21 cmExecutionStatus&);
23 using Elem = std::pair<cm::string_view, Command>;
24 using InitElem = std::pair<cm::static_string_view, Command>;
26 cmSubcommandTable(std::initializer_list<InitElem> init);
28 bool operator()(cm::string_view key, std::vector<std::string> const& args,
29 cmExecutionStatus& status) const;
31 private:
32 std::vector<Elem> Impl;