USGS

Isis 3.0 Object Programmers' Reference

Home

SerialNumberList.h

Go to the documentation of this file.
00001 #ifndef SerialNumberList_h
00002 #define SerialNumberList_h
00003 
00026 #include <string>
00027 #include <map>
00028 #include <vector>
00029 #include "Progress.h"
00030 
00031 class QString;
00032 
00033 namespace Isis {
00087   class SerialNumberList {
00088     public:
00089       SerialNumberList(bool checkTarget = true);
00090       SerialNumberList(const QString &list, bool checkTarget = true,
00091                        Progress *progress = NULL);
00092       virtual ~SerialNumberList();
00093 
00094       void Add(const QString &filename, bool def2filename = false);
00095       void Add(const QString &serialNumber, const QString &filename);
00096       void Add(const char *serialNumber, const char *filename);
00097       bool HasSerialNumber(QString sn);
00098       
00100       void Delete(const QString &sn);
00101 
00102       int Size() const;
00103       QString FileName(const QString &sn);
00104       QString FileName(int index);
00105       QString SerialNumber(const QString &filename);
00106       QString SerialNumber(int index);
00107       QString ObservationNumber(int index);
00108 
00109       int SerialNumberIndex(const QString &sn);
00110       int FileNameIndex(const QString &filename);
00111 
00112       std::vector<QString> PossibleSerialNumbers(const QString &on);
00113 
00114     protected:
00115       struct Pair {
00116         QString filename;
00117         QString serialNumber;
00118         QString observationNumber;
00119       };
00120 
00121       std::vector<Pair> p_pairs;
00122       std::map<QString, int> p_serialMap;
00123       std::map<QString, int> p_fileMap;
00124 
00125       bool p_checkTarget;
00126       QString p_target;
00127 
00128   };
00129 };
00130 
00131 #endif