| 655 | ///////////////////////////////////////////////////////////////////// |
| 656 | |
| 657 | IStreamFileRef loadFileStream( const fs::path &path ) |
| 658 | { |
| 659 | #if defined( CINDER_MSW ) |
| 660 | FILE *f = _wfopen( path.wstring().c_str(), L"rb" ); |
| 661 | #else |
| 662 | FILE *f = fopen( path.string().c_str(), "rb" ); |
| 663 | #endif |
| 664 | |
| 665 | #if defined( CINDER_ANDROID ) |
| 666 | if( nullptr == f ) { |
| 667 | throw StreamExc( "(loadFileStream) couldn't open: " + path.string() ); |
| 668 | } |
| 669 | #endif |
| 670 | |
| 671 | if( f ) { |
| 672 | IStreamFileRef s = IStreamFile::create( f, true ); |
| 673 | s->setFileName( path ); |
| 674 | return s; |
| 675 | } |
| 676 | else |
| 677 | return IStreamFileRef(); |
| 678 | } |
| 679 | |
| 680 | std::shared_ptr<OStreamFile> writeFileStream( const fs::path &path, bool createParents ) |
| 681 | { |
no test coverage detected