42 #include <boost/math/special_functions/fpclassify.hpp>
71 const String& replacement =
"_",
84 const String& replacement =
"_",
139 typename std::enable_if<std::is_arithmetic<typename std::remove_reference<T>::type>::value,
SVOutStream&>::type
operator<<(
const T& value)
141 if (!newline_)
static_cast<std::ostream&
>(*this) << sep_;
142 else newline_ =
false;
143 static_cast<std::ostream&
>(*this) <<
String(value);
149 typename std::enable_if<!std::is_arithmetic<typename std::remove_reference<T>::type>::value,
SVOutStream&>::type
operator<<(
const T& value)
152 static_cast<std::ostream &
>(*this) << sep_;
155 static_cast<std::ostream &
>(*this) << value;
172 template <
typename NumericT>
175 if ((boost::math::isfinite)(thing))
return operator<<(thing);
177 bool old = modifyStrings(
false);
178 if ((boost::math::isnan)(thing))
Stream class for writing to comma/tab/...-separated values files.
Definition: SVOutStream.h:58
String::QuotingMethod quoting_
String quoting method.
Definition: SVOutStream.h:211
bool newline_
Are we at the beginning of a line? (Otherwise, insert separator before next item.)
Definition: SVOutStream.h:217
SVOutStream & operator<<(const char *c_str)
Stream output operator for char*.
SVOutStream & operator<<(std::ostream &(*fp)(std::ostream &))
Stream output operator for manipulators (used to catch std::endl)
std::enable_if<!std::is_arithmetic< typename std::remove_reference< T >::type >::value, SVOutStream & >::type operator<<(const T &value)
Generic stream output operator (for non-character-based types)
Definition: SVOutStream.h:149
std::stringstream ss_
Stream for testing if a manipulator is "std::endl".
Definition: SVOutStream.h:220
SVOutStream & operator<<(enum Newline)
Stream output operator for custom newline (nl) without flushing.
String sep_
Separator string.
Definition: SVOutStream.h:199
SVOutStream & operator<<(String str)
Stream output operator for String.
String inf_
String to use for Inf values.
Definition: SVOutStream.h:208
bool modifyStrings(bool modify)
Switch modification of strings (quoting/replacing of separators) on/off.
SVOutStream & operator<<(const char c)
Stream output operator for char.
SVOutStream(const String &file_out, const String &sep="\t", const String &replacement="_", String::QuotingMethod quoting=String::DOUBLE)
Constructor.
String replacement_
Replacement for separator.
Definition: SVOutStream.h:202
std::enable_if< std::is_arithmetic< typename std::remove_reference< T >::type >::value, SVOutStream & >::type operator<<(const T &value)
Definition: SVOutStream.h:139
SVOutStream & writeValueOrNan(NumericT thing)
Write a numeric value or "nan"/"inf"/"-inf", if applicable (would not be needed for Linux)
Definition: SVOutStream.h:173
SVOutStream & operator<<(const std::string &str)
Stream output operator for std::string.
~SVOutStream() override
Destructor.
String nan_
String to use for NaN values.
Definition: SVOutStream.h:205
SVOutStream(std::ostream &out, const String &sep="\t", const String &replacement="_", String::QuotingMethod quoting=String::DOUBLE)
Constructor.
std::ofstream * ofs_
internal file stream when C'tor is called with a filename
Definition: SVOutStream.h:196
bool modify_strings_
On/off switch for modification of strings.
Definition: SVOutStream.h:214
SVOutStream & write(const String &str)
Unformatted output (no quoting: useful for comments, but use only on a line of its own!...
A more convenient string class.
Definition: String.h:60
QuotingMethod
How to handle embedded quotes when quoting strings.
Definition: String.h:81
@ DOUBLE
Definition: String.h:81
const double c
Definition: Constants.h:214
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
Newline
custom newline indicator
Definition: SVOutStream.h:47
@ nl
Definition: SVOutStream.h:47