// Copyright The libpkgmanifest Authors
// SPDX-License-Identifier: LGPL-2.1-or-later

#pragma once

#include "impl/common/yaml/iyamlparser.hpp"
#include "impl/input/objects/input/iinputparser.hpp"
#include "impl/input/operations/prototypefileconverter/iprototypefileconverter.hpp"
#include "iparser.hpp"

namespace libpkgmanifest::internal::input {

using namespace libpkgmanifest::internal::common;

class Parser : public IParser {
public:
    Parser(
        std::unique_ptr<IYamlParser> yaml_parser,
        std::unique_ptr<IInputParser> input_parser,
        std::unique_ptr<IPrototypeFileConverter> prototype_converter);

    virtual std::unique_ptr<IInput> parse(const std::string & path) const override;
    virtual std::unique_ptr<IInput> parse_from_prototype(const std::string & path) const override;

private:
    std::unique_ptr<IYamlParser> yaml_parser;
    std::unique_ptr<IInputParser> input_parser;
    std::unique_ptr<IPrototypeFileConverter> prototype_converter;
};

}  // namespace libpkgmanifest::internal::input
