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

Method GetPath

PathCopyCopy/plugins/src/LongFolderPlugin.cpp:62–85  ·  view source on GitHub ↗

Returns the long path of the specified file's parent directory. @param p_File File path. @return Long path of parent directory.

Source from the content-addressed store, hash-verified

60 // @return Long path of parent directory.
61 //
62 std::wstring LongFolderPlugin::GetPath(const std::wstring& p_File) const
63 {
64 assert(m_pSettings != nullptr);
65
66 // Call parent to get the long path.
67 std::wstring longPath = LongPathPlugin::GetPath(p_File);
68
69 // If parent appended a separator, remove it here so that we
70 // can properly extract parent folder.
71 if (!longPath.empty() && (longPath.back() == L'\\' || longPath.back() == L'/')) {
72 longPath = longPath.substr(0, longPath.size() - 1);
73 }
74
75 // Extract parent directory.
76 PluginUtils::ExtractFolderFromPath(longPath);
77
78 // If settings instructs us to append separator for directories, append one,
79 // since this plugin always returns directory paths.
80 if (m_pSettings != nullptr && m_pSettings->GetAppendSeparatorForDirectories()) {
81 longPath += L"\\";
82 }
83
84 return longPath;
85 }
86
87 //
88 // Determines if this plugin is androgynous. It is considered androgynous

Callers

nothing calls this directly

Calls 3

emptyMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected