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

Function writeFileStream

src/cinder/Stream.cpp:680–697  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

678}
679
680std::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
699IoStreamFileRef readWriteFileStream( const fs::path &path )
700{

Callers 1

getStreamMethod · 0.85

Calls 8

create_directoriesFunction · 0.85
expandPathFunction · 0.85
has_parent_pathMethod · 0.80
parent_pathMethod · 0.80
wstringMethod · 0.80
createFunction · 0.50
c_strMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected