#pragma once

#include "fs/IWritablePack.h"
#include "fs/FolderPack.h"
#include "fs/Error.h"
#include "fs/Mode.h"
#include "fs/Api.h"

namespace fs
{

class FS_API WritableFolderPack final : virtual public IWritablePack, public FolderPack
{
public:
	explicit WritableFolderPack(AbsPathView location);
	WritableFolderPack(tl::lent_ref<IFilesystem> filesystem, AbsPathView location);
	~WritableFolderPack() override = default;

	OpenSinkResult openSink(AbsPathView i_path, Mode i_mode, SinkFlags i_flags = SinkFlags()) override;
	OpenStreamSinkResult openStreamSink(AbsPathView i_path, Mode i_mode, SinkFlags i_flags = SinkFlags()) override;
	OpenMapSinkResult openMapSink(AbsPathView i_path, Mode i_mode, size_t i_size, SinkFlags i_flags = SinkFlags()) override;

	RemoveResult remove(AbsPathView i_path) override;
	RenameResult rename(AbsPathView i_path, AbsPathView i_newPath) override;

	MakeFolderResult makeFolder(AbsPathView i_path) override;
	RemoveRecursivelyResult removeRecursively(AbsPathView i_path) override;

	SetWriteTimeResult setWriteTime(AbsPathView i_path, time_t i_time) override;
};

}
