Added ProcessStream to for running processes (on Linux) and streaming their output.
Added map() function for creating a mapping iterator. Added mijin::pipe types for map() and join().
This commit is contained in:
@@ -47,6 +47,22 @@ std::string join(const TRange& elements, const char* const delimiter)
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
namespace pipe
|
||||
{
|
||||
struct Join
|
||||
{
|
||||
const char* delimiter;
|
||||
|
||||
explicit Join(const char* delimiter_) noexcept : delimiter(delimiter_) {}
|
||||
};
|
||||
|
||||
template<typename TIterable>
|
||||
auto operator|(TIterable&& iterable, const Join& joiner)
|
||||
{
|
||||
return join(std::forward<TIterable>(iterable), joiner.delimiter);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace mijin
|
||||
|
||||
#endif // !defined(MIJIN_UTIL_STRING_HPP_INCLUDED)
|
||||
|
||||
Reference in New Issue
Block a user