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