Cortex  10.0.0-a4
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
IECore::FileSequence Class Reference

#include <FileSequence.h>

+ Inheritance diagram for IECore::FileSequence:

Public Member Functions

 IE_CORE_DECLARERUNTIMETYPED (FileSequence, RunTimeTyped)
 
 FileSequence (const std::string &fileName, FrameListPtr frameList)
 
 FileSequence (const std::string &fileSequenceStr)
 
const std::string & getFileName () const
 
void setFileName (const std::string &fileName)
 
FrameListgetFrameList ()
 
void setFrameList (FrameListPtr frameList)
 
std::string asString () const
 
unsigned getPadding () const
 
void setPadding (unsigned padding)
 
std::string getPrefix () const
 Returns the part of the fileName before the # sequence representing the frame number.
 
void setPrefix (const std::string &prefix)
 Sets the part of fileName before the # sequence to the string specified by prefix.
 
std::string getSuffix () const
 Returns the part of fileName following the # sequence representing the frame number.
 
void setSuffix (const std::string &suffix)
 Sets the part of fileName following the # sequence to the string specified by suffix.
 
std::string fileNameForFrame (FrameList::Frame frameNumber) const
 
FrameList::Frame frameForFileName (const std::string &fileName) const
 Returns the frame number of a filename from this sequence.
 
void fileNames (std::vector< std::string > &f) const
 
void clumpedFileNames (unsigned clumpSize, std::vector< std::vector< std::string > > &f) const
 
FileSequencePtr copy () const
 Returns a deep copy of this object.
 
void mapTo (const FileSequence *other, std::vector< std::pair< std::string, std::string > > &result) const
 
void mapTo (const FileSequence *other, std::map< std::string, std::string > &result) const
 
bool operator== (const FileSequence &other) const
 
- Public Member Functions inherited from IECore::RunTimeTyped
 IE_CORE_DECLAREMEMBERPTR (RunTimeTyped)
 
virtual TypeId typeId () const
 
virtual const char * typeName () const
 
virtual bool isInstanceOf (TypeId typeId) const
 
virtual bool isInstanceOf (const char *typeName) const
 
- Public Member Functions inherited from IECore::RefCounted
 IE_CORE_DECLAREMEMBERPTR (RefCounted)
 
void addRef () const
 Add a reference to the current object.
 
void removeRef () const
 Remove a reference from the current object.
 
RefCount refCount () const
 Returns the current reference count.
 

Static Public Member Functions

static boost::regex fileNameValidator ()
 
- Static Public Member Functions inherited from IECore::RunTimeTyped
static TypeId staticTypeId ()
 Returns the TypeId for this class, without needing an instance.
 
static const char * staticTypeName ()
 Returns the type name for this class, without needing an instance.
 
static TypeId baseTypeId ()
 
static const char * baseTypeName ()
 
static bool inheritsFrom (TypeId typeId)
 Returns true if this class inherits from the specified type.
 
static bool inheritsFrom (const char *typeName)
 Returns true if this class inherits from the specified type.
 
static bool inheritsFrom (TypeId type, TypeId baseType)
 Returns true if type inherits from baseType.
 
static bool inheritsFrom (const char *typeName, const char *baseTypeName)
 Returns true if typeName inherits from baseTypeName.
 
static TypeId baseTypeId (TypeId typeId)
 Returns the base type of the given type, or InvalidTypeId if no such base exists.
 
static const std::vector< TypeId > & baseTypeIds (TypeId typeId)
 
static const std::set< TypeId > & derivedTypeIds (TypeId typeId)
 
static TypeId typeIdFromTypeName (const char *typeName)
 
static const char * typeNameFromTypeId (TypeId typeId)
 
static void registerType (TypeId derivedTypeId, const char *derivedTypeName, TypeId baseTypeId)
 Allows external modules to register their own type ids.
 

Protected Member Functions

boost::format fileNameTemplate (bool negativeFrame) const
 

Protected Attributes

std::string m_fileName
 
FrameListPtr m_frameList
 

Additional Inherited Members

- Public Types inherited from IECore::RunTimeTyped
typedef RefCounted BaseClass
 A typedef for the class this class derives from. All RunTimeTyped classes define this typedef.
 
- Public Types inherited from IECore::RefCounted
typedef size_t RefCount
 
- Protected Types inherited from IECore::RunTimeTyped
typedef std::map< TypeId, TypeIdBaseTypeRegistryMap
 
typedef std::map< TypeId, std::vector< TypeId > > BaseTypesRegistryMap
 
typedef std::map< TypeId, std::set< TypeId > > DerivedTypesRegistryMap
 
typedef tbb::spin_rw_mutex Mutex
 
typedef std::map< TypeId, std::string > TypeIdsToTypeNamesMap
 
typedef std::map< std::string, TypeIdTypeNamesToTypeIdsMap
 
- Static Protected Member Functions inherited from IECore::RunTimeTyped
static BaseTypeRegistryMap & baseTypeRegistry ()
 
static DerivedTypesRegistryMap & derivedTypesRegistry ()
 
static BaseTypesRegistryMap & completeBaseTypesRegistry ()
 
static DerivedTypesRegistryMap & completeDerivedTypesRegistry ()
 
static void derivedTypeIdsWalk (TypeId typeId, std::set< TypeId > &)
 
static TypeIdsToTypeNamesMap & typeIdsToTypeNames ()
 
static TypeNamesToTypeIdsMap & typeNamesToTypeIds ()
 
- Static Protected Attributes inherited from IECore::RunTimeTyped
static Mutex g_baseTypeIdsMutex
 
static Mutex g_derivedTypeIdsMutex
 

Detailed Description

The FrameList class defines an abstract base class for classes which are able to generate a list of frame numbers.

Constructor & Destructor Documentation

IECore::FileSequence::FileSequence ( const std::string &  fileName,
FrameListPtr  frameList 
)

Constructs a new FileSequence object with the specified fileName, and FrameList. fileName must be a string containing a single sequence of at least # character - this represents the location and padding of the frame numbers.

IECore::FileSequence::FileSequence ( const std::string &  fileSequenceStr)

Constructs a new FileSequence object by parsing the given string. Find the longest space-delimited tail substring that is a parseable FrameList and creates a FileSequence instance which contains that FrameList. Everything before that is considered to be part of the filename.

Member Function Documentation

void IECore::FileSequence::clumpedFileNames ( unsigned  clumpSize,
std::vector< std::vector< std::string > > &  f 
) const

Generates a list of lists of filenames represented by this object, with no more than clumpSize filenames in each sublist.

std::string IECore::FileSequence::fileNameForFrame ( FrameList::Frame  frameNumber) const

Returns a filename for the sequence represented by this object, with the frame number specified by the frameNumber parameter

void IECore::FileSequence::fileNames ( std::vector< std::string > &  f) const

Generates a list of all filenames represented by this object, ordered according to the ordering of frames in the FrameList.

boost::format IECore::FileSequence::fileNameTemplate ( bool  negativeFrame) const
protected

Returns a boost::format for expanding out the filename with a frame number. Due to limitations in boost::format we need use a different template depending on the sign of the frame number.

static boost::regex IECore::FileSequence::fileNameValidator ( )
static

Returns a regular expression that matches only valid filenames. Matches 1, 2, and 3 of any resulting matches are the prefix, padding and suffix of the matched filename.

unsigned IECore::FileSequence::getPadding ( ) const

Returns the frame number padding - this is calculated by looking at the number of # characters in the fileName

void IECore::FileSequence::setPadding ( unsigned  padding)

Sets the frame number padding - this is achieved by modifying the number of # characters in the fileName


The documentation for this class was generated from the following file: