#pragma once

#include "AppConfig.h"
#include "VideoMode.h"

#include <filesystem>
#include <string>

namespace RenderCadenceCompositor
{
class AppConfigProvider
{
public:
	AppConfigProvider();

bool Load(const std::filesystem::path& path, std::string& error);
bool LoadDefault(std::string& error);
	void ApplyCommandLine(int argc, char** argv);

	const AppConfig& Config() const { return mConfig; }
	const std::filesystem::path& SourcePath() const { return mSourcePath; }
	bool LoadedFromFile() const { return mLoadedFromFile; }

private:
	AppConfig mConfig;
	std::filesystem::path mSourcePath;
	bool mLoadedFromFile = false;
};

std::filesystem::path FindConfigFile(const std::filesystem::path& relativePath = "config/runtime-host.json");
std::filesystem::path FindRepoPath(const std::filesystem::path& relativePath);
}
