| 69 | ///////////////////////////////////////////////////////////////////////////////////////////////// |
| 70 | |
| 71 | std::shared_ptr<WriteStream> WriteStream::MakeFromFile(const std::string& filePath) { |
| 72 | if (filePath.empty()) { |
| 73 | return nullptr; |
| 74 | } |
| 75 | auto file = fopen(filePath.c_str(), "wb"); |
| 76 | if (file == nullptr) { |
| 77 | return nullptr; |
| 78 | } |
| 79 | return std::shared_ptr<WriteStream>(new FileWriteStream(file)); |
| 80 | } |
| 81 | |
| 82 | ///////////////////////////////////////////////////////////////////////////////////////////////// |
| 83 |