MCPcopy Create free account
hub / github.com/clechasseur/pathcopycopy / GetPath

Method GetPath

PathCopyCopy/plugins/src/LongNamePlugin.cpp:62–76  ·  view source on GitHub ↗

Returns the long name of the specified file. @param p_File File path. @return Long file name.

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected