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

correction

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: 1793
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent c162ce07
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: gsexx_TCHK2.cc,v 1.4 2003-12-30 17:22:41 tforb Exp $
* $Id: gsexx_TCHK2.cc,v 1.5 2005-07-01 14:17:26 tforb Exp $
* \author Thomas Forbriger
* \date 29/03/2002
*
......@@ -13,13 +13,15 @@
*
* REVISIONS and CHANGES
* - 29/03/2002 V1.0 Thomas Forbriger
* - 01/07/2005 V1.1 The read function still had the usual problems with
* newlines
*
* ============================================================================
*/
#define TF_GSEXX_TCHK2_CC_VERSION \
"TF_GSEXX_TCHK2_CC V1.0 "
"TF_GSEXX_TCHK2_CC V1.1 "
#define TF_GSEXX_TCHK2_CC_CVSID \
"$Id: gsexx_TCHK2.cc,v 1.4 2003-12-30 17:22:41 tforb Exp $"
"$Id: gsexx_TCHK2.cc,v 1.5 2005-07-01 14:17:26 tforb Exp $"
#include<cmath>
#include <gsexx.h>
......@@ -85,13 +87,27 @@ std::string TCHK2::write() const
/*! \relates TCHK2
* Read a checksum CHK2-line from a GSE data file.
*/
void TCHK2::read(std::istream& is)
void TCHK2::read(std::istream& fis)
{
// read lineID first to pass newline after last data character
std::string lineID;
fis >> lineID;
std::cerr << lineID << std::endl;
// now read a full line to chomp newline after checksum too
std::string theline;
std::cerr << theline << std::endl;
std::getline(fis, theline);
std::istringstream is(theline);
if (!GSEIDmatch<TCHK2>(lineID)) throw
Terror("ERROR (CHK2::read): missing CHK2 line!");
is >> this->Msum;
/* former code (01/07/2005)
std::string lineID;
is >> lineID;
if (!GSEIDmatch<TCHK2>(lineID)) throw
Terror("ERROR (TCHK2::read): missing CHK2 line!");
is >> this->Msum;
*/
}
} // namespace waveform
......
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