/* Copyright 2020, Michele Santullo
 * This file is part of orotool.
 *
 * Orotool is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Orotool is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Orotool.  If not, see <http://www.gnu.org/licenses/>.
 */

#pragma once

#include "ini_file.hpp"
#include "oro/source.hpp"
#include <string_view>
#include <cstddef>

namespace duck {

class AppConfig {
public:
	AppConfig();
	~AppConfig() noexcept;

	std::string_view db_path() const;
	std::string_view api_key() const;
	std::size_t worker_threads() const;
	std::size_t fetch_extra_delay() const;
	std::string_view backend() const;
	bool store_raw_json() const;

	std::size_t items_timeout() const;
	std::size_t icons_timeout() const;
	std::size_t shops_timeout() const;
	std::size_t creators_timeout() const;
	oro::SourceFormat json_store_mode() const;

	std::size_t error_retry_timeout() const;
	unsigned int max_connection_retries() const;

private:
	kamokan::IniFile m_ini;
};

} //namespace duck
