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

proceeding

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: 2888
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent eed7508d
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: tsoftdata.cc,v 1.11 2009-11-11 18:07:07 tforb Exp $
* $Id: tsoftdata.cc,v 1.12 2009-11-11 18:15:09 tforb Exp $
* \author Thomas Forbriger
* \date 16/09/2009
*
......@@ -35,7 +35,7 @@
#define DATREAD_TSOFTDATA_CC_VERSION \
"DATREAD_TSOFTDATA_CC V1.0 "
#define DATREAD_TSOFTDATA_CC_CVSID \
"$Id: tsoftdata.cc,v 1.11 2009-11-11 18:07:07 tforb Exp $"
"$Id: tsoftdata.cc,v 1.12 2009-11-11 18:15:09 tforb Exp $"
#include <datreadxx/error.h>
#include <datreadxx/tsoftdata.h>
......@@ -73,7 +73,7 @@ namespace datread {
{
Mhastag=true;
// length without trailing \0
const string::size_type len=line.length()-1;
const string::size_type len=line.length();
// find end of tag
string::size_type i=1;
string::size_type j=line.find_first_of(tagend, i);
......@@ -326,6 +326,17 @@ namespace datread {
return (retval);
} // Tvos channelinfofree(const channelinfo& ci)
/*----------------------------------------------------------------------*/
std::string getDOSline(std::istream& is)
{
std::string inputline;
getline(is, inputline);
// check for DOS file
inputline.replace(inputline.find("\r"), 1, "");
return(trimws(inputline));
} // std::string getDOSline(std::istream& is)
} // namespace tsoft
} // namespace datread
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: tsoftdata.h,v 1.12 2009-11-11 16:21:45 tforb Exp $
* $Id: tsoftdata.h,v 1.13 2009-11-11 18:15:09 tforb Exp $
* \author Thomas Forbriger
* \date 16/09/2009
*
......@@ -39,7 +39,7 @@
#define DATREAD_TSOFTDATA_H_VERSION \
"DATREAD_TSOFTDATA_H V1.0 "
#define DATREAD_TSOFTDATA_H_CVSID \
"$Id: tsoftdata.h,v 1.12 2009-11-11 16:21:45 tforb Exp $"
"$Id: tsoftdata.h,v 1.13 2009-11-11 18:15:09 tforb Exp $"
#include<iostream>
#include<string>
......@@ -125,6 +125,13 @@ namespace datread {
/*----------------------------------------------------------------------*/
/*! \brief helper function getDOSline
* \ingroup tsoft
*/
std::string getDOSline(std::istream& is);
/*----------------------------------------------------------------------*/
/*! \brief contains takes one line and splits it into tag and information.
* \ingroup tsoft
*/
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: tsoftreader.cc,v 1.10 2009-11-11 18:07:07 tforb Exp $
* $Id: tsoftreader.cc,v 1.11 2009-11-11 18:15:09 tforb Exp $
* \author Thomas Forbriger
* \date 16/09/2009
*
......@@ -35,7 +35,7 @@
#define DATREAD_TSOFTREADER_CC_VERSION \
"DATREAD_TSOFTREADER_CC V1.0 "
#define DATREAD_TSOFTREADER_CC_CVSID \
"$Id: tsoftreader.cc,v 1.10 2009-11-11 18:07:07 tforb Exp $"
"$Id: tsoftreader.cc,v 1.11 2009-11-11 18:15:09 tforb Exp $"
#include <iostream>
#include <sstream>
......@@ -101,9 +101,7 @@ namespace datread {
bool inchannels=false;
bool inunits=false;
std::string inputline;
getline(is, inputline);
// check for DOS file
inputline.replace(inputline.find("\r"), 1, "");
inputline=getDOSline(is);
while (is.good())
{
int linelength=datread::tsoft::trimws(inputline).length();
......@@ -206,7 +204,7 @@ namespace datread {
cout << "read units for channel #" << count << endl;
}
// read next line
getline(is, inputline);
inputline=getDOSline(is);
} // while (is.good())
// file is read
// check if input is complete
......
Supports Markdown
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