From: Hyunbin Lee Date: Fri, 26 Apr 2013 02:52:26 +0000 (+0900) Subject: Support path beginning without / for OSP compatible application X-Git-Tag: submit/tizen_2.1/20130514.054102~52^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9d34682323919037f9954cdfb2e8ba76eadc81be;p=framework%2Fosp%2Fappfw.git Support path beginning without / for OSP compatible application Change-Id: I0371269ef8dbc0e5b5d5b842e460bcd46a7aaafa Signed-off-by: Hyunbin Lee --- diff --git a/src/io/FIo_FileImpl.cpp b/src/io/FIo_FileImpl.cpp index fa6a43d..091087f 100644 --- a/src/io/FIo_FileImpl.cpp +++ b/src/io/FIo_FileImpl.cpp @@ -567,22 +567,12 @@ _FileImpl::GetAttributes(const String& filePath, FileAttributes& attribute) String _FileImpl::GetFileName(const String& filePath) { - String fileName; - SysTryReturn(NID_IO, VerifyFilePathCompatibility(filePath, _AppInfo::IsOspCompat()) == true, fileName, E_INVALID_ARG, - "[E_INVALID_ARG] The length of the specified filePath (%ls) is zero or exceeds system limitations.", - filePath.GetPointer()); - return _FileUtil::GetFileName(filePath); } String _FileImpl::GetFileExtension(const String& filePath) { - String extName; - SysTryReturn(NID_IO, VerifyFilePathCompatibility(filePath, _AppInfo::IsOspCompat()) == true, extName, E_INVALID_ARG, - "[E_INVALID_ARG] The length of the specified filePath (%ls) is zero or exceeds system limitations.", - filePath.GetPointer()); - return _FileUtil::GetFileExtension(filePath); } diff --git a/src/io/FIo_FileUtil.cpp b/src/io/FIo_FileUtil.cpp index 974a1d0..6000996 100644 --- a/src/io/FIo_FileUtil.cpp +++ b/src/io/FIo_FileUtil.cpp @@ -373,7 +373,8 @@ _FileUtil::GetFileName(const String& filePath) int pos = -1; result r = filePath.LastIndexOf(L'/', filePath.GetLength() - 1, pos); - SysTryReturn(NID_IO, !IsFailed(r), fileName, E_INVALID_ARG, "[E_INVALID_ARG] The file path is invalid."); + SysTryReturn(NID_IO, r == E_SUCCESS || r == E_OBJ_NOT_FOUND, fileName, E_INVALID_ARG, + "[E_INVALID_ARG] The file path is invalid."); r = filePath.SubString(pos + 1, fileName); SysTryReturn(NID_IO, !IsFailed(r), fileName, E_INVALID_ARG, "[E_INVALID_ARG] The file path is invalid."); @@ -391,7 +392,8 @@ _FileUtil::GetFileExtension(const String& filePath) int pos = -1; result r = filePath.LastIndexOf(L'/', filePath.GetLength() - 1, pos); - SysTryReturn(NID_IO, !IsFailed(r), extName, E_INVALID_ARG, "[E_INVALID_ARG] The file path is invalid."); + SysTryReturn(NID_IO, r == E_SUCCESS || r == E_OBJ_NOT_FOUND, extName, E_INVALID_ARG, + "[E_INVALID_ARG] The file path is invalid."); String fileName; r = filePath.SubString(pos + 1, fileName);