Returns the short UNC path of the specified file. @param p_File File path. @return Short UNC path.
| 58 | // @return Short UNC path. |
| 59 | // |
| 60 | std::wstring ShortUNCPathPlugin::GetPath(const std::wstring& p_File) const |
| 61 | { |
| 62 | // First call inherited to get a long path. |
| 63 | std::wstring path = LongUNCPathPlugin::GetPath(p_File); |
| 64 | |
| 65 | // Now ask for a short version and return it. |
| 66 | if (!path.empty()) { |
| 67 | const auto bufferSize = ::GetShortPathNameW(path.c_str(), nullptr, 0); |
| 68 | if (bufferSize != 0) { |
| 69 | std::wstring shortPath(bufferSize, L'\0'); |
| 70 | if (::GetShortPathNameW(path.c_str(), &*shortPath.begin(), gsl::narrow<DWORD>(shortPath.size())) != 0) { |
| 71 | path = shortPath.c_str(); |
| 72 | } |
| 73 | } |
| 74 | } |
| 75 | return path; |
| 76 | } |
| 77 | |
| 78 | // |
| 79 | // Determines if this plugin is androgynous. It is considered androgynous |