aboutsummaryrefslogtreecommitdiffstats
path: root/config/src/vespa/config/print/fileconfigwriter.h
blob: 9c5e69ca888745c43c11172d899fd4db9e6db4f9 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "configwriter.h"
#include "configformatter.h"
#include <vespa/vespalib/stllike/string.h>

namespace config {

/**
 * Writes a config to file, optionally using a ConfigFormatter for formatting.
 */
class FileConfigWriter : public ConfigWriter {
public:
    FileConfigWriter(const vespalib::string & fileName);
    // Implements ConfigWriter
    bool write(const ConfigInstance & config) override;
    bool write(const ConfigInstance & config, const ConfigFormatter & formatter) override;
private:
    const vespalib::string _fileName;
};

} // namespace config