FileName.hxx
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #ifndef FILENAME_H
00008 #define FILENAME_H
00009
00010 #include <string>
00011
00012 #include "DataMethod.hxx"
00013 #include "FitsFile.h"
00014 #include "Options.h"
00015
00017 template<typename DataType>
00018 class FileName : public DataMethod<DataType>
00019 {
00020 public:
00022 FileName(const FitsFile& aFile)
00023 {
00024 DataMethod<DataType>::methodName = "FileName";
00025 Options options;
00026 if (StringOps::ToLower(options.getArchive()) == "wsa")
00027 {
00028 mFileName = "djoser:" + aFile.getFileName();
00029 } else {
00030 mFileName = aFile.getFileName();
00031 }
00032 }
00033
00035 virtual ~FileName() { }
00036
00038 void setSource(IntMap& tbls, IntMap& cols, StringMap units) { }
00039
00041 void setTarget(IntMap& cols, StringMap units)
00042 {
00043 colNo = cols[0];
00044 }
00045
00047 void doit(TableData<DataType>& data, int row1, int row2)
00048 {
00049 for (int rowNo = row1; rowNo < row2; ++rowNo)
00050 {
00051 data.assign(colNo, rowNo, mFileName);
00052 }
00053 }
00054
00055
00056 void doit2(TableData<DataType>& rawData, TableData<DataType>& data, int row1, int row2) { }
00057
00058 private:
00059 int colNo;
00060 std::string mFileName;
00061 };
00062
00063 #endif
00064
00065
00066
00067
00068