Using PathView to pass paths to APIs
This commit is contained in:
+3
-3
@@ -60,7 +60,7 @@ CopyStreamResult copyStream(IStreamSink& sink, IStreamSource& source, const Proc
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CopyStreamResult copyFile(IStreamSink& sink, const IFilesystem& filesystem, const AbsPath& filePath, size_t bufferSize)
|
||||
CopyStreamResult copyFile(IStreamSink& sink, const IFilesystem& filesystem, AbsPathView filePath, size_t bufferSize)
|
||||
{
|
||||
OUTCOME_TRY(const auto source, filesystem.openStreamSource(filePath, IFilesystem::SourceFlags(IFilesystem::SourceFlag::SequentialHint, IFilesystem::SourceFlag::Unbuffered)));
|
||||
return copyStream(sink, *source, bufferSize);
|
||||
@@ -68,13 +68,13 @@ CopyStreamResult copyFile(IStreamSink& sink, const IFilesystem& filesystem, cons
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CopyStreamResult copyFile(IStreamSink& sink, const IFilesystem& filesystem, const AbsPath& filePath, const ProcessDataCallback& dataCallback, size_t bufferSize)
|
||||
CopyStreamResult copyFile(IStreamSink& sink, const IFilesystem& filesystem, AbsPathView filePath, const ProcessDataCallback& dataCallback, size_t bufferSize)
|
||||
{
|
||||
OUTCOME_TRY(const auto source, filesystem.openStreamSource(filePath, IFilesystem::SourceFlags(IFilesystem::SourceFlag::SequentialHint, IFilesystem::SourceFlag::Unbuffered)));
|
||||
return copyStream(sink, *source, dataCallback, bufferSize);
|
||||
}
|
||||
|
||||
CopyStreamResult copyFile(IFilesystem& dstFilesystem, const AbsPath& dstFilePath, const IFilesystem& srcFilesystem, const AbsPath& srcFilePath, size_t bufferSize)
|
||||
CopyStreamResult copyFile(IFilesystem& dstFilesystem, AbsPathView dstFilePath, const IFilesystem& srcFilesystem, AbsPathView srcFilePath, size_t bufferSize)
|
||||
{
|
||||
OUTCOME_TRY(const auto sink, dstFilesystem.openStreamSink(dstFilePath, fs::Mode::CreateOrOpenAndClear));
|
||||
OUTCOME_TRY(const auto source, srcFilesystem.openStreamSource(srcFilePath, IFilesystem::SourceFlags(IFilesystem::SourceFlag::SequentialHint, IFilesystem::SourceFlag::Unbuffered)));
|
||||
|
||||
Reference in New Issue
Block a user