pfs::FrameFileIterator Class Reference

Utility class that can be used to iterate over file names specified as command line arguments. More...

#include <pfs.h>

List of all members.

Public Member Functions

 FrameFileIterator (int &argc, char *argv[], const char *fopenMode, const char *fileNamePrefix=NULL, FILE *stdinout=NULL, const char *optstring=NULL, const struct option *getopt_long=NULL)
 Creates new iterator over frame files.
FrameFile getNextFrameFile ()
 Get the file handle FILE* and file name for the next frame.
void closeFrameFile (FrameFile &frameFile)
 Close file openned with getNextFrameFile.


Detailed Description

Utility class that can be used to iterate over file names specified as command line arguments.

It can handle patterns, like frame04d.hdr, where 04d is replaced with specified range of frame numbers.

Definition at line 471 of file pfs.h.


Constructor & Destructor Documentation

pfs::FrameFileIterator::FrameFileIterator ( int &  argc,
char *  argv[],
const char *  fopenMode,
const char *  fileNamePrefix = NULL,
FILE *  stdinout = NULL,
const char *  optstring = NULL,
const struct option *  getopt_long = NULL 
)

Creates new iterator over frame files.

Command line arguments are parsed and all recognized arguments are removed.

Parameters:
argc argument count passed to program's main function.
argv argument values passed to program's main function.
fopenMode mode used to fopen frame files, usually "rb" or "wb"
fileNamePrefix each frame pattern must be preceded with this string (for example "-i'). If NULL, every argument that does not start with "-" is treated as a frame pattern.
stdinout if set, treat '-' file name specially and instead of opening a named file, use filedescriptor passed as this parameter. It should be used to get or write data to stdin / stdout.
optstring parameter string passed to getopt() function. When optstring != NULL, FrameFileIterator will skip all parameters and their required arguments. Optional arguments are not handled.
getopt_long parameter structure passed to getopt_long() function. When getopt_long != NULL, FrameFileIterator will skip all parameters and their required arguments. Optional arguments are not handled.
Exceptions:
CommandLineException on bad syntax of command line options


Member Function Documentation

FrameFile pfs::FrameFileIterator::getNextFrameFile (  ) 

Get the file handle FILE* and file name for the next frame.

Note that fileName string is valid until next call to getNextFrameFile or closeFrameFile.

When file handle is no longer needed, closeFileFile should be called.

Returns:
file handle FILE* and file name of the next frame. Returns file handle == NULL if there are no more frames.
Exceptions:
Exception if the file is not found

void pfs::FrameFileIterator::closeFrameFile ( FrameFile frameFile  ) 

Close file openned with getNextFrameFile.

Parameters:
frameFile FrameFile object returned from getNextFrameFile


The documentation for this class was generated from the following file:
Generated on Tue Nov 25 17:23:48 2008 for Portable Floating-point Streams (pfstools) by  doxygen 1.5.3