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);
}
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.");
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);