41 #ifndef DATRW_UTIL_H_VERSION 43 #define DATRW_UTIL_H_VERSION \ 50 #include<aff/iterator.h> 73 template<
class Cin,
class Cout>
80 aff::Iterator<Cout> IO(retval);
81 aff::Browser<Cin> BI(
data);
82 ::datrw::report_conversion<Tinvalue, Toutvalue>(std::cout);
83 while (IO.valid() && BI.valid())
86 *IO=
static_cast<Toutvalue
>(sample);
106 template<
class Cin,
class Cout>
110 outdata=convert<Cin, Cout>(
data);
145 "::?series): number of samples is not positive!";
149 errorstr =
"ERROR ("+
streamname+
"::?series): bad stream!";
150 ::datrw::report_conversion<double, typename C::Tvalue>(std::cout);
155 series(i) =
static_cast<typename
C::Tvalue>(inval);
185 std::string
clipstring(std::string& s,
const std::string& delim=
":");
206 std::string
trimws(std::string s);
212 #endif // DATRW_UTIL_H_VERSION (includeguard) std::string commatospace(std::string s)
#define DATRW_assert(C, M)
Check an assertion and report by throwing an exception.
C readasciidouble(std::istream &is, const int nsamples, const std::string &streamname)
read the trace data
Cout convert(const typename Cin::Tcoc &data)
function template to convert a whole series
const char *const streamname
name of the stream
handle data types and data type conversion (prototypes)
const int nsamples
number of samples per minute block and channel
exception class declaration for libdatrwxx (prototypes)
const char *const data
keywords for consistency checks
std::string trimws(std::string s)
remove leading and trailing whitespace
Root namespace of library.
int ntrailingdigits(double v, const bool &debug)
return number of trailing digits (after decimal point)
int nsignificantdigits(double v, const bool &debug)
return number of significant digits
std::string clipstring(std::string &s, const std::string &delim)
strip substringStrips off first substring up to given delimiter. The string is passed as a reference ...