| 678 | } |
| 679 | |
| 680 | std::shared_ptr<OStreamFile> writeFileStream( const fs::path &path, bool createParents ) |
| 681 | { |
| 682 | if( createParents && path.has_parent_path() ) { |
| 683 | fs::create_directories( path.parent_path() ); |
| 684 | } |
| 685 | #if defined( CINDER_MSW ) |
| 686 | FILE *f = _wfopen( expandPath( path ).wstring().c_str(), L"wb" ); |
| 687 | #else |
| 688 | FILE *f = fopen( expandPath( path ).string().c_str(), "wb" ); |
| 689 | #endif |
| 690 | if( f ) { |
| 691 | OStreamFileRef s = OStreamFile::create( f, true ); |
| 692 | s->setFileName( path ); |
| 693 | return s; |
| 694 | } |
| 695 | else |
| 696 | return std::shared_ptr<OStreamFile>(); |
| 697 | } |
| 698 | |
| 699 | IoStreamFileRef readWriteFileStream( const fs::path &path ) |
| 700 | { |
no test coverage detected