Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (33 sloc) 746 Bytes
#ifndef STICPP_FILTER_H
#define STICPP_FILTER_H
#include <iostream>
#include <iterator>
#include <algorithm>
namespace stiX {
template <typename Transformer, typename OutputType = std::string>
void filter(
std::istream &in,
std::ostream &out,
Transformer t
) {
std::transform(
std::istreambuf_iterator<char>(in),
std::istreambuf_iterator<char>(),
std::ostream_iterator<OutputType>(out),
t
);
}
template <typename Transformer>
void raw_filter(
std::istream &in,
std::ostream &out,
Transformer t
) {
filter<Transformer, char>(
in,
out,
t
);
}
}
#endif //STICPP_FILTER_H
You can’t perform that action at this time.