| 151 | } |
| 152 | |
| 153 | auto CUtility::GetFileName(const std::wstring& fullPath, bool withExtension) -> std::wstring |
| 154 | { |
| 155 | std::filesystem::path pathObj(fullPath); |
| 156 | |
| 157 | // Check if file name is required without extension |
| 158 | if (withExtension == false) |
| 159 | { |
| 160 | // Check if file has stem i.e. filename without extension |
| 161 | if (pathObj.has_stem()) |
| 162 | { |
| 163 | // return the stem (file name without extension) from path object |
| 164 | return pathObj.stem().wstring(); |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | // return the file name with extension from path object |
| 169 | return pathObj.filename().wstring(); |
| 170 | } |
| 171 | |
| 172 | auto CUtility::GetFileExtension(const std::wstring& fileName) -> std::wstring |
| 173 | { |