Support path beginning without / for OSP compatible application
authorHyunbin Lee <hyunbin.lee@samsung.com>
Fri, 26 Apr 2013 02:52:26 +0000 (11:52 +0900)
committerGerrit Code Review <gerrit2@kim11>
Mon, 29 Apr 2013 00:23:10 +0000 (09:23 +0900)
Change-Id: I0371269ef8dbc0e5b5d5b842e460bcd46a7aaafa
Signed-off-by: Hyunbin Lee <hyunbin.lee@samsung.com>
src/io/FIo_FileImpl.cpp
src/io/FIo_FileUtil.cpp

index fa6a43d..091087f 100644 (file)
@@ -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);
 }
 
index 974a1d0..6000996 100644 (file)
@@ -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);