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

Method GetPath

PathCopyCopy/plugins/src/COMPlugin.cpp:219–236  ·  view source on GitHub ↗

Transforms the given path using the plugin. @param p_File Full path to file. @return Transformed path.

Source from the content-addressed store, hash-verified

217 // @return Transformed path.
218 //
219 std::wstring COMPlugin::GetPath(const std::wstring& p_File) const
220 {
221 // Call method and make sure it works.
222 // Note that it is legal for the method to return NULL or an empty string.
223 ATL::CComBSTR bstrPath(p_File.c_str());
224 ATL::CComBSTR bstrNewPath;
225 const HRESULT hRes = m_cpPlugin->GetPath(bstrPath, &bstrNewPath);
226 if (FAILED(hRes)) {
227 throw COMPluginError(hRes);
228 }
229
230 // Convert path if provided, otherwise reuse same one.
231 std::wstring newPath(p_File);
232 if (bstrNewPath != nullptr && bstrNewPath.Length() > 0) {
233 newPath = (LPWSTR) bstrNewPath;
234 }
235 return newPath;
236 }
237
238 //
239 // Called by Path Copy Copy to know if it should honor the

Callers

nothing calls this directly

Calls 1

COMPluginErrorClass · 0.85

Tested by

no test coverage detected