/* VFile.h */ /* remap Copyright (C) 2006 Fabrice Ducos, fabrice.ducos@icare.univ-lille1.fr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef VFile_H #define VFile_H #include "VInput.h" class VFile : public VInput { public: VFile(const char *filename, const char *dataset, int ichannel = 0, const char *sds_time = NULL, const char *sds_latitude = "Latitude", const char *sds_longitude = "Longitude") : VInput(), ichannel_(ichannel) { PDEBUG; assert(filename); strncpy(latlon_filename_, filename, STRING_MAXLEN); strncpy(time_filename_, filename, STRING_MAXLEN); strncpy(data_filename_, filename, STRING_MAXLEN); if (sds_time) strncpy(sds_time_, sds_time, STRING_MAXLEN); else *sds_time_ = '\0'; if (sds_latitude) strncpy(sds_lat_, sds_latitude, STRING_MAXLEN); else *sds_lat_ = '\0'; if (sds_longitude) strncpy(sds_lon_, sds_longitude, STRING_MAXLEN); else *sds_lon_ = '\0'; assert(dataset); strncpy(sds_data_, dataset, STRING_MAXLEN); } ~VFile() { PDEBUG; } virtual std::string filename() const { return std::string(data_filename_); } virtual std::string dataset() const { return std::string(sds_data_); } virtual void get_calibration(double &slope, double &offset) const = 0; protected: char latlon_filename_[STRING_MAXLEN + 1]; char time_filename_[STRING_MAXLEN + 1]; char data_filename_[STRING_MAXLEN + 1]; char sds_lat_[STRING_MAXLEN + 1]; char sds_lon_[STRING_MAXLEN + 1]; char sds_time_[STRING_MAXLEN + 1]; char sds_data_[STRING_MAXLEN + 1]; int ichannel_; }; #endif