DATRW++ library: seismic data I/O with multiple formats
util.h File Reference

utilities used by more than one type of data reader (prototypes) More...

#include <iostream>
#include <string>
#include <datrwxx/error.h>
#include <datrwxx/datatypes.h>
#include <aff/iterator.h>
Include dependency graph for util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 datrw
 Root namespace of library.
 
 datrw::util
 Some components used by several I/O format modules.
 

Macros

#define DATRW_UTIL_H_VERSION   "DATRW_UTIL_H V1.3"
 

Functions

std::string datrw::util::clipstring (std::string &s, const std::string &delim=":")
 strip substringStrips off first substring up to given delimiter. The string is passed as a reference and will be modified (i.e. the stripped substring as well as the delimiter will be erased). More...
 
std::string datrw::util::commatospace (std::string s)
 
template<class Cin , class Cout >
Cout datrw::util::convert (const typename Cin::Tcoc &data)
 function template to convert a whole series More...
 
template<class Cin , class Cout >
void datrw::util::convert (const Cin &data, Cout &outdata)
 two-argument conversion function which allows template function specialization More...
 
template<class C >
void datrw::util::convert (const C &data, C &outdata)
 specialization of function in case where no conversion is required More...
 
int datrw::util::nsignificantdigits (double v, const bool &debug)
 return number of significant digits More...
 
int datrw::util::ntrailingdigits (double v, const bool &debug=false)
 return number of trailing digits (after decimal point) More...
 
template<class C >
datrw::util::readasciidouble (std::istream &is, const int nsamples, const std::string &streamname)
 read the trace data More...
 
std::string datrw::util::trimws (std::string s)
 remove leading and trailing whitespace More...
 

Detailed Description

utilities used by more than one type of data reader (prototypes)


Author
Thomas Forbriger
Date
22/12/2004

utilities used by more than one type of data reader (prototypes)


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 St, Fifth Floor, Boston, MA 02110-1301 USA

Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach)

REVISIONS and CHANGES

  • 22/12/2004 V1.0 Thomas Forbriger
  • 29/07/2011 V1.1 added clipstring
  • 02/09/2011 V1.2 remove DATRW_debug from here, this macro is presented in debug.h already
  • 06/09/2011 V1.3 moved string manipulation functions to this file: commatospace and trimws

Definition in file util.h.