diff --git a/inc/hgl/io/FileOutputStream.h b/inc/hgl/io/FileOutputStream.h index 3d823c9..5e5a2cb 100644 --- a/inc/hgl/io/FileOutputStream.h +++ b/inc/hgl/io/FileOutputStream.h @@ -88,6 +88,19 @@ namespace hgl FileOutputStream *operator &(){return fos;} FileOutputStream *operator ->(){return fos;} };//class OpenFileInputStream + + inline FileOutputStream *CreateFileOutputStream(const OSString &filename,FileOpenMode fom=FileOpenMode::CreateTrunc)///<创建一个文件输出流 + { + auto *fos=new FileOutputStream(); + + if(!fos->Open(filename,fom)) + { + delete fos; + return(nullptr); + } + + return fos; + } }//namespace io }//namespace hgl #endif//HGL_IO_FILE_OUTPUT_STREAM_INCLUDE