IStream *NewIStream(const Path& p, unsigned int stype) { if (POV_ALLOW_FILE_READ(p().c_str(), stype) == false) // TODO FIXME - this is handled by the frontend, but that code isn't completely there yet [trf] { string str ("IO Restrictions prohibit read access to '") ; str += UCS2toASCIIString(p()); str += "'"; throw POV_EXCEPTION(kCannotOpenFileErr, str); } return new IFileStream(p().c_str()); }
IStream *NewIStream(const Path& p, const unsigned int stype) { Pointer<IStream> istreamptr(POV_PLATFORM_BASE.CreateIStream(stype)); if(istreamptr == NULL) return NULL; if (POV_ALLOW_FILE_READ(p().c_str(), stype) == false) // TODO FIXME - this is handled by the frontend, but that code isn't completely there yet [trf] { string str ("IO Restrictions prohibit read access to '") ; str += UCS2toASCIIString(p()); str += "'"; throw POV_EXCEPTION(kCannotOpenFileErr, str); } if(istreamptr->open(p().c_str()) == 0) return NULL; return istreamptr.release(); }
IStream *New_Checked_IStream(char *filename, unsigned int stype) { if(POV_ALLOW_FILE_READ(filename, stype) == true) return New_IStream(filename, stype); return NULL; }