| 40 | } |
| 41 | |
| 42 | unique_ptr<StructuredFile> StructuredDirectory::CreateStructuredFile(const std::wstring& name) { |
| 43 | CheckNameLength(name); |
| 44 | |
| 45 | CComPtr<IStream> spStm; |
| 46 | auto hr = GetStorage()->CreateStream(name.c_str(), STGM_CREATE | STGM_READWRITE | |
| 47 | STGM_SHARE_EXCLUSIVE, 0, 0, &spStm); |
| 48 | if (FAILED(hr)) |
| 49 | return nullptr; |
| 50 | |
| 51 | return unique_ptr<StructuredFile>(new StructuredFile(spStm)); |
| 52 | } |
| 53 | |
| 54 | unique_ptr<StructuredFile> StructuredDirectory::OpenStructuredFile(const std::wstring& name) { |
| 55 | CheckNameLength(name); |
no outgoing calls
no test coverage detected