From 258f7aca01b3f558a026f2b3d82576fafff4a884 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 1 Apr 2019 21:52:23 +0200 Subject: [PATCH] [DEV] add move in the provider files --- etk/uri/provider/ProviderFile.cpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/etk/uri/provider/ProviderFile.cpp b/etk/uri/provider/ProviderFile.cpp index fc411d8..8fbaae6 100644 --- a/etk/uri/provider/ProviderFile.cpp +++ b/etk/uri/provider/ProviderFile.cpp @@ -103,7 +103,15 @@ bool etk::uri::provider::ProviderFile::canMove() { } bool etk::uri::provider::ProviderFile::move(const etk::Uri& _uriSource, const etk::Uri& _uriDestination) { - return etk::path::move(_uriSource.getPath(), _uriDestination.getPath()); + etk::Path pathSource =_uriSource.getPath(); + if (m_offset.isEmpty() == false) { + pathSource = m_offset / _uriSource.getPath(); + } + etk::Path pathDestination =_uriDestination.getPath(); + if (m_offset.isEmpty() == false) { + pathDestination = m_offset / _uriDestination.getPath(); + } + return etk::path::move(pathSource, pathDestination); } bool etk::uri::provider::ProviderFile::canCopy() { @@ -111,7 +119,15 @@ bool etk::uri::provider::ProviderFile::canCopy() { } bool etk::uri::provider::ProviderFile::copy(const etk::Uri& _uriSource, const etk::Uri& _uriDestination) { - return etk::path::copy(_uriSource.getPath(), _uriDestination.getPath()); + etk::Path pathSource =_uriSource.getPath(); + if (m_offset.isEmpty() == false) { + pathSource = m_offset / _uriSource.getPath(); + } + etk::Path pathDestination =_uriDestination.getPath(); + if (m_offset.isEmpty() == false) { + pathDestination = m_offset / _uriDestination.getPath(); + } + return etk::path::copy(pathSource, pathDestination); } bool etk::uri::provider::ProviderFile::canRemove() { @@ -119,5 +135,9 @@ bool etk::uri::provider::ProviderFile::canRemove() { } bool etk::uri::provider::ProviderFile::remove(const etk::Uri& _uri) { - return etk::path::remove(_uri.getPath()); + etk::Path pathSource =_uri.getPath(); + if (m_offset.isEmpty() == false) { + pathSource = m_offset / _uri.getPath(); + } + return etk::path::remove(pathSource); }