smartfile.h

Go to the documentation of this file.
00001 /* === S Y N F I G ========================================================= */
00021 /* ========================================================================= */
00022 
00023 /* === S T A R T =========================================================== */
00024 
00025 #ifndef __SYNFIG_SMARTFILE_H
00026 #define __SYNFIG_SMARTFILE_H
00027 
00028 /* === H E A D E R S ======================================================= */
00029 
00030 #include <cstdio>
00031 #include <ETL/smart_ptr>
00032 
00033 /* === M A C R O S ========================================================= */
00034 
00035 /* === T Y P E D E F S ===================================================== */
00036 
00037 /* === C L A S S E S & S T R U C T S ======================================= */
00038 
00039 namespace synfig {
00040 
00041 struct _FILE_deleter
00042 {
00043     void operator()(FILE* x)const { if(x!=stdout && x!=stdin) fclose(x); }
00044 };
00045 
00046 typedef etl::smart_ptr<FILE,_FILE_deleter> SmartFILE;
00047 
00048 }; // END of namespace synfig
00049 
00050 /* === E N D =============================================================== */
00051 
00052 #endif

Generated on Wed Aug 15 05:00:23 2007 for synfig by  doxygen 1.5.3