Isis 3 Programmer Reference
Isis::FileList Class Reference

Internalizes a list of files. More...

#include <FileList.h>

Inheritance diagram for Isis::FileList:
Inheritance graph
Collaboration diagram for Isis::FileList:
Collaboration graph

Public Member Functions

 FileList (FileName listFile)
 Creates a FileList based on a FileName. More...
 
 FileList (std::istream &in)
 Constructs a FileList from an istream. More...
 
 FileList ()
 Creates an empty FileList obj. More...
 
 ~FileList ()
 Destroys the FileList object. More...
 
void read (FileName listFile)
 reads in a FileName obj More...
 
void read (std::istream &in)
 reads in an istream More...
 
void write (FileName outputFileList)
 writes to a FileName obj More...
 
void write (std::ostream &out)
 writes to an ostream More...
 

Detailed Description

Internalizes a list of files.

This class reads a list of filenames from a file an internalizes them in a standard template vector of strings. Thus, a file like:

m0035431.imq
m0030402.imq
m0033231.imq
.
.
.
m0203331.imq

Will be internalized as and accessable as an vector.

Author
2003-05-01 Jeff Anderson
History:

2003-05-16 Stuart Sides - modified schema from astrogeology... isis.astrogeology...

2005-03-16 Leah Dahmer - modified file to support Doxygen documentation.

2006-04-05 Elizabeth Miller - Added error message to catch empty files

2007-01-04 Brendan George - Added comment recognition and it now only reads the first column

2007-02-19 Stacy Alley - modified the Read method such that if a file name and it's attributes are surround with double quotes, then don't use commas as a 'end of line' signal.

2017-08-15 Adam Goins - removed a printf() that resulted in extraneous output to be displayed. Ref#5112

2017-09-22 Cole Neubauer - Fixed documentation. References #4708

Definition at line 70 of file FileList.h.

Constructor & Destructor Documentation

◆ FileList() [1/3]

Isis::FileList::FileList ( FileName  listFile)

Creates a FileList based on a FileName.

Constructs a FileList from a FileName.

Parameters
listFileA FileName obj

Definition at line 47 of file FileList.cpp.

◆ FileList() [2/3]

Isis::FileList::FileList ( std::istream &  in)

Constructs a FileList from an istream.

Parameters
inthe istream to read from

Definition at line 56 of file FileList.cpp.

◆ FileList() [3/3]

Isis::FileList::FileList ( )

Creates an empty FileList obj.

Constructs an empty FileList.

Definition at line 38 of file FileList.cpp.

◆ ~FileList()

Isis::FileList::~FileList ( )
inline

Destroys the FileList object.

Definition at line 84 of file FileList.h.

Member Function Documentation

◆ read() [1/2]

void Isis::FileList::read ( FileName  listFile)

reads in a FileName obj

Opens and loads the list of files from a file.

Parameters
listFileName of the file to open that contains the list of files.
Exceptions
Isis::iException::Io- Cannot open file

Definition at line 68 of file FileList.cpp.

References _FILEINFO_, Isis::Message::FileOpen(), and Isis::FileName::toString().

Referenced by Isis::Equalization::addHolds(), and Isis::Equalization::loadOutputs().

◆ read() [2/2]

void Isis::FileList::read ( std::istream &  in)

reads in an istream

Loads list of files from a stream.

This takes in a stream and loads a file list from it. The lines in the stream are considered separate entries, and comments are ignored. comments are considered to be any line starting with a '#' or '//', and anything after any whitespace following the first text on the line.

Parameters
inAn input stream containing a list of files.

Definition at line 102 of file FileList.cpp.

References _FILEINFO_, Isis::IString::Token(), Isis::IString::ToQt(), Isis::IString::TrimHead(), and Isis::IString::TrimTail().

◆ write() [1/2]

void Isis::FileList::write ( FileName  outputFileList)

writes to a FileName obj

Writes a list of files to a file.

Parameters
outputFileListThe name of the file to create. The method will overwrite any existing files.
Exceptions
Isis::iException::IoFile could not be created.

Definition at line 175 of file FileList.cpp.

References _FILEINFO_, Isis::Message::FileOpen(), and Isis::FileName::toString().

◆ write() [2/2]

void Isis::FileList::write ( std::ostream &  out)

writes to an ostream

Writes a list of files to a stream.

Parameters
outThe list will be written to this output stream.

Definition at line 197 of file FileList.cpp.


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