4#include "MRPch/MRBindingMacros.h"
23 File(
File && r ) : handle_( r.handle_ ) { r.detach(); }
24 File(
const std::filesystem::path & filename,
const char * mode ) {
open( filename, mode ); }
28 File& operator =(
File && r ) {
close(); handle_ = r.handle_; r.detach();
return *
this; }
30 operator FILE *()
const {
return handle_; }
32 MRMESH_API FILE *
open(
const std::filesystem::path & filename,
const char * mode );
38 void attach( FILE * h ) {
if ( handle_ != h ) {
close(); handle_ = h; } }
41 FILE * handle_ =
nullptr;
#define MRMESH_API
Definition MRMeshFwd.h:80
void attach(FILE *h)
gives control over the handle to this object
Definition MRFile.h:38
File(const File &)=delete
void detach()
the user takes control over the handle
Definition MRFile.h:36
MR_BIND_IGNORE FILE * fopen(const std::filesystem::path &filename, const char *mode)
this version of fopen unlike std::fopen supports unicode file names on Windows
~File()
Definition MRFile.h:25
FILE * open(const std::filesystem::path &filename, const char *mode)
std::array< Vector3f, 3 > MR_BIND_IGNORE
Definition MRMeshBuilderTypes.h:13
File(const std::filesystem::path &filename, const char *mode)
Definition MRFile.h:24
File(File &&r)
Definition MRFile.h:23
only for bindings generation
Definition MRCameraOrientationPlugin.h:8