| 12345678910111213141516171819202122232425262728293031 |
- #pragma once
- #include <iostream>
- #include <sstream>
- #include <string>
- #include "types.h"
- namespace build {
- class command_builder {
- private:
- indent_t indent_;
- std::stringstream buffer_;
- public:
- command_builder(std::string const & cmd, int indent = 0);
- template <typename T> command_builder && operator<<(T const & value) &&;
- template <typename T> command_builder & operator<<(T const & value) &;
- template <typename T>
- command_builder & operator<<(std::vector<T> const & value) &;
- int execute() const;
- private:
- template <typename T> void write(T const & value) { buffer_ << value; }
- void write(version const & vers);
- void write(source_file const & file);
- void write(output_file const & file);
- };
- }
|