// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "istreamconfigreader.h" #include namespace config { template IstreamConfigReader::IstreamConfigReader(std::istream & is) : _is(is) { } template std::unique_ptr IstreamConfigReader::read(const ConfigFormatter & formatter) { ConfigDataBuffer buffer; std::stringstream buf; buf << _is.rdbuf(); buffer.setEncodedString(buf.str()); formatter.decode(buffer); return std::make_unique(buffer); } template std::unique_ptr IstreamConfigReader::read() { StringVector lines; std::string line; while (getline(_is, line)) { lines.push_back(line); } return std::make_unique(ConfigValue(std::move(lines))); } } // namespace config