summaryrefslogtreecommitdiffstats
path: root/Source/cmCustomCommandLines.h
diff options
context:
space:
mode:
authorDaniel Eiband <daniel.eiband@brainlab.com>2019-09-13 17:44:37 (GMT)
committerDaniel Eiband <daniel.eiband@brainlab.com>2019-09-16 18:45:41 (GMT)
commit7f3ecbe7d7210667770d3212e2bfdb0c701cdc5d (patch)
treefed5733ab7c5219c0f5377a2b3fcb2674ac27b55 /Source/cmCustomCommandLines.h
parent1ac4e0ef1b29affc9e4f2cd86c4fc8c2252f2ab2 (diff)
downloadCMake-7f3ecbe7d7210667770d3212e2bfdb0c701cdc5d.zip
CMake-7f3ecbe7d7210667770d3212e2bfdb0c701cdc5d.tar.gz
CMake-7f3ecbe7d7210667770d3212e2bfdb0c701cdc5d.tar.bz2
cmCustomCommandLine: Provide command line make functions
Reduce boilerplate necessary to create custom command lines by introducing and applying cmMakeCommandLine and cmMakeSingleCommandLine functions.
Diffstat (limited to 'Source/cmCustomCommandLines.h')
-rw-r--r--Source/cmCustomCommandLines.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/Source/cmCustomCommandLines.h b/Source/cmCustomCommandLines.h
index 35a15ba..213aeb1 100644
--- a/Source/cmCustomCommandLines.h
+++ b/Source/cmCustomCommandLines.h
@@ -5,25 +5,28 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <initializer_list>
#include <string>
#include <vector>
+#include "cm_string_view.hxx" // IWYU pragma: keep
+
/** Data structure to represent a single command line. */
class cmCustomCommandLine : public std::vector<std::string>
{
-public:
- using Superclass = std::vector<std::string>;
- using iterator = Superclass::iterator;
- using const_iterator = Superclass::const_iterator;
};
/** Data structure to represent a list of command lines. */
class cmCustomCommandLines : public std::vector<cmCustomCommandLine>
{
-public:
- using Superclass = std::vector<cmCustomCommandLine>;
- using iterator = Superclass::iterator;
- using const_iterator = Superclass::const_iterator;
};
+/** Return a command line from a list of command line parts. */
+cmCustomCommandLine cmMakeCommandLine(
+ std::initializer_list<cm::string_view> ilist);
+
+/** Return a command line vector with a single command line. */
+cmCustomCommandLines cmMakeSingleCommandLine(
+ std::initializer_list<cm::string_view> ilist);
+
#endif