MCPcopy Create free account
hub / github.com/alamaison/swish / _CreateFileContentsStream

Method _CreateFileContentsStream

swish/shell_folder/SftpDataObject.cpp:302–317  ·  view source on GitHub ↗

* Create an IStream for relative path stored in the lindexth FILEDESCRIPTOR. * * @p lindex corresponds to an item in the File Group Descriptor (which * we created in _DelayRenderCfFileGroupDescriptor) with the same index. * * @note Asking for an IStream to folder may not break (libssh2 can do * this) but it is a waste of effort. Explorer won't use it, nor should it. */

Source from the content-addressed store, hash-verified

300 * this) but it is a waste of effort. Explorer won't use it, nor should it.
301 */
302com_ptr<IStream> CSftpDataObject::_CreateFileContentsStream(long lindex)
303throw(...)
304{
305 ATLENSURE(m_fRenderedDescriptor);
306
307 // Pull the FILEGROUPDESCRIPTOR we made earlier out of the DataObject
308 CFormatEtc fetc(m_cfFileDescriptor);
309 StorageMedium medium;
310 HRESULT hr = GetData(&fetc, medium.out());
311 ATLENSURE_SUCCEEDED(hr);
312 FileGroupDescriptor fgd(medium.get().hGlobal);
313
314 // Get stream from relative path stored in the lindexth FILEDESCRIPTOR
315 CSftpDirectory dir(m_pidlCommonParent, m_provider);
316 return dir.GetFileByPath(fgd[lindex].path().string().c_str(), false);
317}
318
319/**
320 * Expand all top-level PIDLs into a list of Descriptors with relative paths.

Callers

nothing calls this directly

Calls 4

outMethod · 0.80
GetFileByPathMethod · 0.80
getMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected