Returns the short name of the specified file. @param p_File File path. @return Short file name.
| 60 | // @return Short file name. |
| 61 | // |
| 62 | std::wstring ShortNamePlugin::GetPath(const std::wstring& p_File) const |
| 63 | { |
| 64 | // Call parent to get the short path. |
| 65 | std::wstring shortPath = ShortPathPlugin::GetPath(p_File); |
| 66 | |
| 67 | // Get the last part, the file name. |
| 68 | size_t lastDelimiterPos = shortPath.find_last_of(L"/\\"); |
| 69 | if (lastDelimiterPos == shortPath.size() - 1) { |
| 70 | // Delimiter is at the end, remove it and get name just before that. |
| 71 | shortPath = shortPath.substr(0, lastDelimiterPos); |
| 72 | lastDelimiterPos = shortPath.find_last_of(L"/\\"); |
| 73 | } |
| 74 | return lastDelimiterPos != std::wstring::npos |
| 75 | ? shortPath.substr(lastDelimiterPos + 1) : shortPath; |
| 76 | } |
| 77 | |
| 78 | // |
| 79 | // Determines if this plugin is androgynous. It is considered androgynous |