* 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. */
| 300 | * this) but it is a waste of effort. Explorer won't use it, nor should it. |
| 301 | */ |
| 302 | com_ptr<IStream> CSftpDataObject::_CreateFileContentsStream(long lindex) |
| 303 | throw(...) |
| 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. |
nothing calls this directly
no test coverage detected