Nuke binary plugins 15.1.4
 
Loading...
Searching...
No Matches
DD::Image::FileOp Class Referenceabstract

#include <FileOp.h>

Inheritance diagram for DD::Image::FileOp:
DD::Image::CodecOp DD::Image::ReadGeo DD::Image::WriteGeo DD::Image::Read DD::Image::TimelineRead

Public Member Functions

 FileOp ()
 
virtual ~FileOp ()
 
virtual Opop ()=0
 
void Reload_Button (Knob_Callback f)
 
int version () const
 
void setVersion (int newVersion)
 
void internalError (const char *fmt,...)
 
void internalErrorV (const char *fmt, va_list args)
 
int replaced_knobs () const
 
int extra_knobs () const
 
Knobplacemarker () const
 
KnobextraPlacemarker () const
 
virtual const char * getFilename () const =0
 
virtual const char * file_type () const =0
 
virtual FileHandler * handler () const =0
 
virtual void filehandler_knobs (Knob_Callback f)
 
virtual int filehandler_knob_changed (Knob *k)
 
virtual int filehandler_knob_change_finished (Knob *k, bool changeByUser)
 
virtual void filehandler_extra_knobs (Knob_Callback f)
 
virtual void replaceable_knobs (Knob_Callback f)
 
virtual void extra_knobs (Knob_Callback f)
 
void replace_knobs (const void *id, const char *fileExt)
 Change the set of knobs in response to the user changing the filename or the file type pulldown.
 
const void * replaced_knobs_id () const
 
void add_extra_knobs (const void *id, const char *fileExt)
 
const void * extra_knobs_id () const
 

Static Public Member Functions

static const char * StripPrefix (const char *filename, std::string *prefix=nullptr)
 
static const char * StripSuffix (const char *filename, std::string *suffix=nullptr)
 
static bool GetFormatAndName (const char *fname, std::string &format, std::string &name)
 
static const char *const * file_types (const char *suffix, const char *altsuffix, const char **prefixDenylist, const char **extras, const char **obsoleteIDs=nullptr)
 Return an array of names of file types known about. This is generated by searching the pluigin directories for any plugins called "*Writer.plugin_ext". The first location in the array is a blank string for 'unknown' and the array is NULL-terminated.
 
static void AddAlias (const char *from, const char *to)
 
static const char * LookupAlias (const char *from)
 

Protected Attributes

bool _readerError
 whether or not the reader is in error (set by internalError)
 
std::string _readerErrorString
 the last reader error (set by internalError)
 

Detailed Description

This class is a mixin class for Read/Write/ReadGeo/WriteGeo etc. It allows file-format-specific knobs to be substituted in to a particular place more easily

Constructor & Destructor Documentation

◆ FileOp()

DD::Image::FileOp::FileOp ( )
inline

constructor

◆ ~FileOp()

virtual DD::Image::FileOp::~FileOp ( )
inlinevirtual

descructor

Member Function Documentation

◆ GetFormatAndName()

bool FileOp::GetFormatAndName ( const char *  fname,
std::string &  format,
std::string &  name 
)
static

parse fname and figure out what fileformat it should be in, and the remaining filename to use. If the filename is prefixed with "format:" it will strip that out and use it as the format, putting the remainder of the filename in name, otherwise it will place the extension in format and the full filename in name.

Returns true if it found both components, false otherwise.

◆ Reload_Button()

void FileOp::Reload_Button ( Knob_Callback  f)

◆ internalError()

void FileOp::internalError ( const char *  fmt,
  ... 
)

Normally calls Op::error(), but prefixes "filename: " to the message. This also switches it so that it produces a checkerboard pattern, so the Reader is not called anymore.

Referenced by DD::Image::Read::_validate().

◆ replaced_knobs()

int DD::Image::FileOp::replaced_knobs ( ) const
inline

get the number of replaced knobs

Referenced by replaceable_knobs().

◆ extra_knobs() [1/2]

int DD::Image::FileOp::extra_knobs ( ) const
inline

get the number of extra knobs

Referenced by extra_knobs().

◆ placemarker()

Knob * DD::Image::FileOp::placemarker ( ) const
inline

the placemarker: the knob immediately before the first file-format-specific knobs

Referenced by replace_knobs().

◆ extraPlacemarker()

Knob * DD::Image::FileOp::extraPlacemarker ( ) const
inline

the placemarker: the knob immediately before the extra file-format-specific knobs

Referenced by add_extra_knobs().

◆ file_type()

virtual const char * DD::Image::FileOp::file_type ( ) const
pure virtual

get the file extension of the file format

Implemented in DD::Image::Write, and DD::Image::WriteGeo.

◆ handler()

virtual FileHandler * DD::Image::FileOp::handler ( ) const
pure virtual

return the file format handler for the current knob settings

Referenced by extra_knobs(), filehandler_extra_knobs(), filehandler_knob_change_finished(), filehandler_knob_changed(), filehandler_knobs(), and replaceable_knobs().

◆ filehandler_knobs()

void FileOp::filehandler_knobs ( Knob_Callback  f)
virtual

insert in the file-format specific file handle knobs.

References handler().

◆ filehandler_knob_changed()

int FileOp::filehandler_knob_changed ( Knob k)
virtual

call file-format specific file handle knob callbacks.

References handler().

◆ filehandler_knob_change_finished()

int FileOp::filehandler_knob_change_finished ( Knob k,
bool  changeByUser 
)
virtual

call file-format specific file handle knob callbacks.

References handler().

◆ filehandler_extra_knobs()

void FileOp::filehandler_extra_knobs ( Knob_Callback  f)
virtual

insert in the extra file-format specific file handle knobs.

References handler().

◆ replaceable_knobs()

void FileOp::replaceable_knobs ( Knob_Callback  f)
virtual

insert in the file-format specific knobs. subclasses should call this in their knobs() implementation

References DD::Image::Op::add_knobs(), handler(), and replaced_knobs().

◆ extra_knobs() [2/2]

void FileOp::extra_knobs ( Knob_Callback  f)
virtual

insert in the file-format specific knobs. subclasses should call this in their knobs() implementation

References DD::Image::Op::add_knobs(), extra_knobs(), and handler().

◆ replace_knobs()

void FileOp::replace_knobs ( const void *  id,
const char *  fileExt 
)

Change the set of knobs in response to the user changing the filename or the file type pulldown.

If the id is different, replace the knobs by calling the above. Subclasses should call this in e.g. knob_changed() after the handler has changed

References placemarker(), and DD::Image::Op::replace_knobs().

Referenced by DD::Image::Read::make_format().

◆ replaced_knobs_id()

const void * DD::Image::FileOp::replaced_knobs_id ( ) const
inline

return the id sent to replace_knobs() most recently. 0 is the initial value.

◆ add_extra_knobs()

void FileOp::add_extra_knobs ( const void *  id,
const char *  fileExt 
)

If the id is different, replace the knobs by calling the above. Subclasses should call this in e.g. knob_changed() after the handler has changed

References extraPlacemarker(), and DD::Image::Op::replace_knobs().

◆ extra_knobs_id()

const void * DD::Image::FileOp::extra_knobs_id ( ) const
inline

return the id sent to replace_knobs() most recently. 0 is the initial value.

◆ file_types()

const char *const * FileOp::file_types ( const char *  suffix,
const char *  altsuffix,
const char **  prefixDenylist,
const char **  extras,
const char **  obsoleteIDs = nullptr 
)
static

Return an array of names of file types known about. This is generated by searching the pluigin directories for any plugins called "*Writer.plugin_ext". The first location in the array is a blank string for 'unknown' and the array is NULL-terminated.

Helper function for implementation of Write::file_types() and WriteGeo::file_types() and similar functions. Suffix is a user-specific suffix (e.g. "WriterGeo"), altsuffix is an (optional) backwards-compatability suffix to look for ("Writer")

prefixDenyList is a pointer to a NULL-terminated list of strings to not include (these are compared to the start of the found string, so "foo" would block foobar", for example.) It can be NULL.

extras is a pointer to a NULL-terminated list of strings to force to be included in the list, even if no matching plugins were found. It can be NULL.

obsoleteIDs is an (optional) pointer to a NULL-terminated list of strings to extend with obsoleteIDs. This allows file types to have synonyms. The format is: id\t\t\tobsoleteID1,obsoleteID2,... For example, to make ffmpeg load as mov64: mov64\t\t\tffmpeg

References DD::Image::plugin_ext, DD::Image::plugin_path(), and DD::Image::plugin_path_list().

◆ LookupAlias()

const char * FileOp::LookupAlias ( const char *  from)
static

look up a file extension alias. If there is no alias, returns the core extension.



©2024 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.foundry.com