aboutsummaryrefslogtreecommitdiffstats
path: root/config/src/vespa/config/print/fileconfigreader.h
blob: d2894e6e0ed62f71aefc7c51091b9488212871f8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "configreader.h"

namespace config {

template <typename ConfigType>
class FileConfigReader : public ConfigReader<ConfigType> {
public:
    FileConfigReader(const vespalib::string & fileName);

    // Implements ConfigReader
    std::unique_ptr<ConfigType> read(const ConfigFormatter & formatter) override;

    /**
     * Read config from this file using old config format.
     *
     * @return An instance of the correct type.
     */
    std::unique_ptr<ConfigType> read();
private:
    const vespalib::string _fileName;
};

} // namespace config