MCPcopy Create free account
hub / github.com/cinder/Cinder / loadFileStream

Function loadFileStream

src/cinder/Stream.cpp:657–678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

655/////////////////////////////////////////////////////////////////////
656
657IStreamFileRef 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
680std::shared_ptr<OStreamFile> writeFileStream( const fs::path &path, bool createParents )
681{

Callers 3

createBufferMethod · 0.85
createStreamMethod · 0.85
initMethod · 0.85

Calls 4

wstringMethod · 0.80
createFunction · 0.50
c_strMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected