USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::FileList Class Reference
[Parsing]

#include <FileList.h>

Inheritance diagram for Isis::FileList:

Inheritance graph
[legend]
Collaboration diagram for Isis::FileList:

Collaboration graph
[legend]
List of all members.

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

For internal use only.

History:
2003-05-16 Stuart Sides - modified schema from astrogeology... isis.astrogeology...
History:
2005-03-16 Leah Dahmer - modified file to support Doxygen documentation.
History:
2006-04-05 Elizabeth Miller - Added error message to catch empty files
History:
2007-01-04 Brendan George - Added comment recognition and it now only reads the first column
History:
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.

Definition at line 66 of file FileList.h.

Public Member Functions

 FileList (const std::string &list)
 Constructs a FileList from a file.
 FileList (std::istream &in)
 Constructs a FileList from a stream.
 FileList ()
 Constructs an empty FileList.
 ~FileList ()
 Destroys the FileList object.
void Read (const std::string &list)
 Opens and loads the list of files from a file.
void Read (std::istream &in)
 Loads list of files from a stream.
void Write (const std::string &list)
 Writes a list of files to a file.
void Write (std::ostream &out)
 Writes a list of files to a stream.


Constructor & Destructor Documentation

Isis::FileList::FileList const std::string &  list  ) 
 

Constructs a FileList from a file.

Parameters:
list Name of the file containing a list of files.

Definition at line 44 of file FileList.cpp.

References Read().

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

Constructs a FileList from a stream.

Parameters:
in An input stream containing a list of files.

Definition at line 53 of file FileList.cpp.

References Read().

Isis::FileList::FileList  ) 
 

Constructs an empty FileList.

Definition at line 36 of file FileList.cpp.

Isis::FileList::~FileList  )  [inline]
 

Destroys the FileList object.

Definition at line 73 of file FileList.h.


Member Function Documentation

void Isis::FileList::Read std::istream &  in  ) 
 

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:
in An input stream containing a list of files.

Definition at line 102 of file FileList.cpp.

References Isis::iString::TrimHead(), and Isis::iString::TrimTail().

void Isis::FileList::Read const std::string &  list  ) 
 

Opens and loads the list of files from a file.

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

Definition at line 64 of file FileList.cpp.

References _FILEINFO_, e, Isis::Filename::Expanded(), Isis::Message::FileOpen(), in, and Isis::iException::Message().

Referenced by FileList().

void Isis::FileList::Write std::ostream &  out  ) 
 

Writes a list of files to a stream.

Parameters:
out The list will be written to this output stream.

Definition at line 198 of file FileList.cpp.

References size.

void Isis::FileList::Write const std::string &  list  ) 
 

Writes a list of files to a file.

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

Definition at line 173 of file FileList.cpp.

References _FILEINFO_, Isis::Filename::Expanded(), Isis::Message::FileOpen(), and Isis::iException::Message().


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