#pragma once
#include "Error.h"
#include "fs/Api.h"
#include "fs/ProcessStream.h"
#include "tl/result.h"
#include "fs/AbsPath.h"

namespace fs
{
//////////////////////////////////////////////////////////////////////////

class IStreamSink;
class IStreamSource;
class IFilesystem;

using CopyStreamResult = tl::result<uint64_t, Error>;
FS_API CopyStreamResult copyStream(IStreamSink& sink, IStreamSource& source, size_t bufferSize = 0);
FS_API CopyStreamResult copyStream(IStreamSink& sink, IStreamSource& source, const ProcessDataCallback& dataCallback, size_t bufferSize = 0);
FS_API CopyStreamResult copyFile(IStreamSink& sink, const IFilesystem& filesystem, AbsPathView filePath, size_t bufferSize = 0);
FS_API CopyStreamResult copyFile(IStreamSink& sink, const IFilesystem& filesystem, AbsPathView filePath, const ProcessDataCallback& dataCallback, size_t bufferSize = 0);
FS_API CopyStreamResult copyFile(IFilesystem& dstFilesystem, AbsPathView dstFilePath, const IFilesystem& srcFilesystem, AbsPathView srcFilePath, size_t bufferSize = 0);

//////////////////////////////////////////////////////////////////////////
}
