#pragma once

//#pragma warning( disable : 4250)

#include "fs/IFilesystem.h"
#include "fs/AbsPath.h"
#include "fs/Error.h"
#include "fs/Mode.h"

#include "fs/Api.h"

namespace fs
{
class ISource;
class IMapSource;

class FS_API IPack
{
public:
	virtual ~IPack() = default;

	using SourceFlag = IFilesystem::SourceFlag;
	using SourceFlags = IFilesystem::SourceFlags;
	using MapView = IFilesystem::MapView;

	virtual OpenSourceResult openSource(AbsPathView i_path, SourceFlags i_flags = SourceFlags()) const = 0;
	virtual OpenStreamSourceResult openStreamSource(AbsPathView i_path, SourceFlags i_flags = SourceFlags()) const = 0;
	virtual OpenMapSourceResult openMapSource(AbsPathView i_path, MapView i_mapView = MapView(), SourceFlags i_flags = SourceFlags()) const = 0;

	virtual IsFileResult isFile(AbsPathView i_path) const = 0;
	virtual IsFolderResult isFolder(AbsPathView i_path) const = 0;
	virtual ExistsResult exists(AbsPathView i_path) const = 0;

	virtual GetStatResult getStat(AbsPathView i_path) const = 0;

	virtual cppcoro::generator<EnumerateEntry> enumerate(AbsPath i_path) const = 0;
	virtual cppcoro::generator<EnumerateEntry> enumerateRecursively(AbsPath i_path) const = 0;

	virtual ConvertToNativePathResult convertToNativePath(AbsPathView i_path) const = 0;

protected:
	IPack() = default;
};

}
