82 FileHeader fileheader;
83 fileheader.hasfilefree =
false;
84 fileheader.hassrce =
false;
86 while (hot && is.good())
90 if (line ==
"contents of SFF SRCE line:")
92 fileheader.hassrce =
true;
95 std::cout <<
"SFF SRCE line detected." << std::endl;
99 fileheader.srce.type = line;
102 if (line ==
"cartesian")
104 fileheader.srce.cs = sff::CS_cartesian;
108 fileheader.srce.cs = sff::CS_spherical;
112 fileheader.srce.cx = std::atof(line.c_str());
115 fileheader.srce.cy = std::atof(line.c_str());
118 fileheader.srce.cz = std::atof(line.c_str());
121 std::istringstream iss(line);
123 int doy, day, month, year, hour, minute, secs, micsecs;
125 iss >> day >> c >> month >> c >> year;
126 iss >> hour >> c >> minute >> c >> secs >> c >> micsecs;
127 fileheader.srce.date = libtime::TAbsoluteTime(year,
136 "ERROR: inconsistent date values");
139 if (line ==
"contents of SFF FREE block:")
141 fileheader.hasfilefree =
true;
144 std::cout <<
"file FREE block detected." << std::endl;
146 while (getline(is, line))
154 fileheader.filefree.append(line);
157 if (line ==
"file header contains no FREE block")
#define DATRW_assert(C, M)
Check an assertion and report by throwing an exception.
void extract(std::string &line)
splits a given string after the colon
void extractvalue(std::string &line, bool unit)
split given string