#include <Reader.h>

Classes | |
| class | ReaderDescription |
| struct | ReaderFns |
Public Member Functions | |
| IE_CORE_DECLARERUNTIMETYPED (Reader, Op) | |
| const std::string & | fileName () const |
| virtual CompoundObjectPtr | readHeader () |
| ObjectPtr | read () |
Protected Member Functions | |
| Reader (const std::string &description, ParameterPtr resultParameter=0) | |
Protected Attributes | |
| FileNameParameterPtr | m_fileNameParameter |
Factory functions | |
| //////////////////////////////////////////////////////////////////////// | |
| typedef boost::function < ReaderPtr(const std::string &fileName)> | CreatorFn |
| typedef boost::function< bool(const std::string &fileName)> | CanReadFn |
| static ReaderPtr | create (const std::string &fileName) |
| static void | supportedExtensions (std::vector< std::string > &extensions) |
| static void | supportedExtensions (TypeId typeId, std::vector< std::string > &extensions) |
| static void | registerReader (const std::string &extensions, CanReadFn canRead, CreatorFn creator, TypeId typeId) |
| typedef boost::function<bool ( const std::string &fileName )> IECore::Reader::CanReadFn |
Definition of a function to answer the question can this file be read?
| typedef boost::function<ReaderPtr ( const std::string &fileName )> IECore::Reader::CreatorFn |
Definition of a function which can create a Reader when given a fileName.
| Reader::Reader | ( | const std::string & | description, | |
| ParameterPtr | resultParameter = 0 | |||
| ) | [protected] |
If resultParameter is not specified then creates a resultParameter which is a simple Parameter instance. If a derived class provides more concrete constraints on the type of the result it should pass an appropriate resultParameter in its initialiser.
References m_fileNameParameter, IECore::PathParameter::MustExist, and IECore::Parameterised::parameters().
| ReaderPtr Reader::create | ( | const std::string & | fileName | ) | [static] |
| const std::string & Reader::fileName | ( | ) | const |
Returns the name of the file this Reader is set to read. Actually calls parameters()->parameter<FileNameParameter>( "fileName" )->getTypedValue(); and therefore can potentially throw an Exception if the fileName is invalid.
References m_fileNameParameter.
Referenced by IECoreRI::SLOReader::doOperation(), IECoreRI::PTCParticleReader::doOperation(), IECore::ObjectReader::doOperation(), IECore::BGEOParticleReader::doOperation(), IECore::PDCParticleReader::readAttribute(), IECore::ObjectReader::readHeader(), IECore::TIFFImageReader::readTypedChannel(), IECore::TGAImageReader::readTypedChannel(), IECore::SGIImageReader::readTypedChannel(), and IECore::TIFFImageReader::setDirectory().
| ObjectPtr Reader::read | ( | ) |
Reads the file specified by fileName() and returns it in the form of an Object. This function actually just calls Op::operate() - it's provided for backwards compatibility and prettier syntax.
References IECore::Op::operate().
Referenced by IECore::NParticleReader::readAttribute().
| CompoundObjectPtr Reader::readHeader | ( | ) | [virtual] |
Returns the file header in the file specified by fileName(). This is intended to give fast access to some information about the contents of the file, without having to load the entire thing. Classes implementing this method should call the base class method first, and append any additional data to the CompoundObject it returns.
Reimplemented in IECore::EXRImageReader, IECore::ImageReader, and IECore::ObjectReader.
| void Reader::registerReader | ( | const std::string & | extensions, | |
| CanReadFn | canRead, | |||
| CreatorFn | creator, | |||
| TypeId | typeId | |||
| ) | [static] |
Registers a Reader type which is capable of reading files ending with the space separated extensions specified (e.g. "tif tiff"). Before creating a reader the canRead function will be called as a final check that the Reader is appropriate - if this returns true then the creator function will then be called. If a file has no extension then all registered canRead functions are called in a last ditch attempt to find a suitable reader. Typically you will not call this function directly to register a reader type - you will instead use the ReaderDescription registration utility class below.
References IECore::InvalidTypeId, and IECore::CamelCase::split().
| void Reader::supportedExtensions | ( | TypeId | typeId, | |
| std::vector< std::string > & | extensions | |||
| ) | [static] |
Fills the passed vector with all the extensions for which a Reader of, or inherited from, the given type is available. Extensions are of the form "tif" - ie without a preceding '.'.
References IECoreMaya::ParameterClipboardUI::copy(), and IECore::RunTimeTyped::derivedTypeIds().
| void Reader::supportedExtensions | ( | std::vector< std::string > & | extensions | ) | [static] |
Fills the passed vector with all the extensions for which a Reader is available. Extensions are of the form "tif" - ie without a preceding '.'.
References IECoreMaya::ParameterClipboardUI::copy().
FileNameParameterPtr IECore::Reader::m_fileNameParameter [protected] |
Referenced by IECore::BGEOParticleReader::BGEOParticleReader(), IECore::BINMeshReader::doOperation(), fileName(), IECore::IFFHairReader::IFFHairReader(), IECore::NParticleReader::NParticleReader(), IECore::ObjectReader::ObjectReader(), IECore::OBJReader::OBJReader(), IECore::PDCParticleReader::PDCParticleReader(), IECoreRI::PTCParticleReader::PTCParticleReader(), Reader(), and IECoreRI::SLOReader::SLOReader().
1.5.8