Commit e66066cc authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

added debug options

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 1627
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent eee3f521
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: sff.h,v 1.4 2004-09-17 10:06:13 tforb Exp $
* $Id: sff.h,v 1.5 2005-01-26 17:51:43 tforb Exp $
* \author Thomas Forbriger
* \date 30/03/2004
*
......@@ -23,7 +23,7 @@
#define DATREAD_SFF_H_VERSION \
"DATREAD_SFF_H V1.0 "
#define DATREAD_SFF_H_CVSID \
"$Id: sff.h,v 1.4 2004-09-17 10:06:13 tforb Exp $"
"$Id: sff.h,v 1.5 2005-01-26 17:51:43 tforb Exp $"
#include<datreadxx/datread.h>
......@@ -33,7 +33,7 @@ namespace datread {
class isffstream: public idatstream {
public:
typedef idatstream Tbase;
isffstream(std::istream& is);
isffstream(std::istream& is, const bool& debug=false);
virtual ~isffstream() { }
virtual Tdseries dseries();
virtual Tfseries fseries();
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: sff.cc,v 1.4 2004-09-17 10:06:14 tforb Exp $
* $Id: sff.cc,v 1.5 2005-01-26 17:51:44 tforb Exp $
* \author Thomas Forbriger
* \date 30/03/2004
*
......@@ -19,16 +19,17 @@
#define DATREAD_SFF_CC_VERSION \
"DATREAD_SFF_CC V1.0 "
#define DATREAD_SFF_CC_CVSID \
"$Id: sff.cc,v 1.4 2004-09-17 10:06:14 tforb Exp $"
"$Id: sff.cc,v 1.5 2005-01-26 17:51:44 tforb Exp $"
#include <datreadxx/sff.h>
#include <sffxx.h>
namespace datread {
isffstream::isffstream(std::istream& is): Tbase(is, true, true, true)
isffstream::isffstream(std::istream& is, const bool& debug):
Tbase(is, true, true, true)
{
sff::FileHeader fileheader(Mis);
sff::FileHeader fileheader(Mis, debug);
if (fileheader.hasfree()) { this->setfilefree(fileheader.free()); }
if (fileheader.hassrce()) { this->setsrce(fileheader.srce()); }
}
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: sffxx.cc,v 1.13 2005-01-26 17:14:27 tforb Exp $
* $Id: sffxx.cc,v 1.14 2005-01-26 17:51:31 tforb Exp $
* \author Thomas Forbriger
* \date 21/12/2003
*
......@@ -26,7 +26,7 @@
#define TF_SFFXX_CC_VERSION \
"TF_SFFXX_CC V1.4"
#define TF_SFFXX_CC_CVSID \
"$Id: sffxx.cc,v 1.13 2005-01-26 17:14:27 tforb Exp $"
"$Id: sffxx.cc,v 1.14 2005-01-26 17:51:31 tforb Exp $"
#include<sstream>
#include <sffxx.h>
......@@ -116,13 +116,16 @@ namespace sff {
return(retval);
} // STAT::line()
void STAT::read(std::istream& fis)
void STAT::read(std::istream& fis, const bool& debug)
{
if (debug) { std::cerr << "DEBUG (STAT::read):" << std::endl; }
std::string theline;
std::getline(fis, theline);
std::istringstream is(theline);
if (debug) { std::cerr << theline << std::endl; }
std::string lineID;
is >> lineID;
if (debug) { std::cerr << lineID << std::endl; }
if (!helper::IDmatch<STAT>(lineID)) throw
GSE2::Terror("ERROR (STAT::read): missing STAT ID!");
......@@ -404,9 +407,9 @@ namespace sff {
if (Mstat.hassrce) { os << Msrce.line(); }
}
void FileHeader::read(std::istream& is)
void FileHeader::read(std::istream& is, const bool& debug)
{
Mstat.read(is);
Mstat.read(is, debug);
if (Mstat.hasfree) { Mfree.read(is); }
if (Mstat.hassrce) { Msrce.read(is); }
}
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: sffxx.h,v 1.21 2005-01-26 17:14:27 tforb Exp $
* $Id: sffxx.h,v 1.22 2005-01-26 17:51:32 tforb Exp $
* \author Thomas Forbriger
* \date 21/12/2003
*
......@@ -30,7 +30,7 @@
#define TF_SFFXX_H_VERSION \
"TF_SFFXX_H V1.3"
#define TF_SFFXX_H_CVSID \
"$Id: sffxx.h,v 1.21 2005-01-26 17:14:27 tforb Exp $"
"$Id: sffxx.h,v 1.22 2005-01-26 17:51:32 tforb Exp $"
#include<string>
#include<cmath>
......@@ -84,9 +84,9 @@ namespace sff {
static const double libversion;
static const char* const LINEID;
STAT();
STAT(std::istream& is) { read(is); }
STAT(std::istream& is, const bool& debug=false) { read(is, debug); }
std::string line() const;
void read(std::istream& is);
void read(std::istream& is, const bool& debug=false);
void setstamp(const libtime::TAbsoluteTime& date) const;
public:
mutable std::string timestamp;
......@@ -185,9 +185,10 @@ namespace sff {
FileHeader(const SRCE& srce, const FREE& free):
Mfree(free), Msrce(srce)
{ Mstat.hasfree=true; Mstat.hassrce=true; }
FileHeader(std::istream& is) { read(is); }
FileHeader(std::istream& is, const bool& debug=false)
{ read(is, debug); }
void write(std::ostream&) const;
void read(std::istream&);
void read(std::istream&, const bool& debug=false);
const STAT& stat() const { return(Mstat); }
const FREE& free() const { return(Mfree); }
const SRCE& srce() const { return(Msrce); }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment