Summary: ##byLine## already yields StringPieces, no neat to ##eachAs()## then.
Test Plan:
fbconfig folly/experimental/symbolizer folly/test folly/experimental/io folly/experimental/io/test tupperware/agent
fbmake opt
Reviewed By: tudorb@fb.com
FB internal diff:
D630422
size_t pageSize = 0;
boost::cmatch match;
- bool error = gen::byLine("/proc/meminfo") | gen::eachAs<StringPiece>() |
+ bool error = gen::byLine("/proc/meminfo") |
[&] (StringPiece line) -> bool {
if (boost::regex_match(line.begin(), line.end(), match, regex)) {
StringPiece numStr(line.begin() + match.position(1), match.length(1));
boost::cmatch match;
MappedFile foundFile;
- bool error = gen::byLine("/proc/self/maps") | gen::eachAs<StringPiece>() |
+ bool error = gen::byLine("/proc/self/maps") |
[&] (StringPiece line) -> bool {
CHECK(boost::regex_match(line.begin(), line.end(), match, mapLineRegex));
uint64_t begin = fromHex(sp(match[1]));
TEST(PopenSubprocessTest, PopenRead) {
Subprocess proc("ls /", Subprocess::pipeStdout());
int found = 0;
- gen::byLine(proc.stdout()) | gen::eachAs<StringPiece>() |
+ gen::byLine(proc.stdout()) |
[&] (StringPiece line) {
if (line == "etc" || line == "bin" || line == "usr") {
++found;