11MRMESH_API FILE *
fopen(
const std::filesystem::path & filename,
const char * mode );
19 File(
File && r ) : handle_( r.handle_ ) { r.detach(); }
20 File(
const std::filesystem::path & filename,
const char * mode ) {
open( filename, mode ); }
26 operator FILE *()
const {
return handle_; }
28 MRMESH_API FILE *
open(
const std::filesystem::path & filename,
const char * mode );
34 void attach( FILE * h ) {
if ( handle_ != h ) {
close(); handle_ = h; } }
37 FILE * handle_ =
nullptr;
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
the class to open C FILE handle and automatically close it in the destructor
Definition MRFile.h:15
File & operator=(const File &)=delete
void attach(FILE *h)
gives control over the handle to this object
Definition MRFile.h:34
MRMESH_API FILE * open(const std::filesystem::path &filename, const char *mode)
File(const File &)=delete
void detach()
the user takes control over the handle
Definition MRFile.h:32
~File()
Definition MRFile.h:21
File(const std::filesystem::path &filename, const char *mode)
Definition MRFile.h:20
File(File &&r)
Definition MRFile.h:19
Definition MRCameraOrientationPlugin.h:7
MRMESH_API FILE * fopen(const std::filesystem::path &filename, const char *mode)
this version of fopen unlike std::fopen supports unicode file names on Windows