Stream class for writing to comma/tab/...-separated values files. More...
#include <OpenMS/FORMAT/SVOutStream.h>
Inherits std::ostream.
Public Member Functions | |
| SVOutStream (std::ostream &out, const String &sep="\t", const String &replacement="_", String::QuotingMethod quoting=String::DOUBLE) | |
| Constructor. | |
| SVOutStream & | operator<< (String str) |
Stream output operator for String. | |
| SVOutStream & | operator<< (const std::string &str) |
Stream output operator for std::string. | |
| SVOutStream & | operator<< (const char *c_str) |
Stream output operator for char*. | |
| SVOutStream & | operator<< (const char c) |
Stream output operator for char. | |
| SVOutStream & | operator<< (std::ostream &(*fp)(std::ostream &)) |
Stream output operator for manipulators (used to catch std::endl). | |
| template<typename T > | |
| SVOutStream & | operator<< (const T &value) |
| Generic stream output operator (for non-character-based types). | |
| SVOutStream & | write (const String &str) |
| Unformatted output (no quoting: useful for comments, but use only on a line of its own!). | |
| bool | modifyStrings (bool modify) |
| Switch modification of strings (quoting/replacing of separators) on/off. | |
| template<typename NumericT > | |
| SVOutStream & | writeValueOrNan (NumericT thing) |
| Write a numeric value or "nan"/"inf"/"-inf", if applicable (would not be needed for Linux). | |
Protected Attributes | |
| String | sep_ |
| Separator string. | |
| String | replacement_ |
| Replacement for separator. | |
| String | nan_ |
| String to use for NaN values. | |
| String | inf_ |
| String to use for Inf values. | |
| String::QuotingMethod | quoting_ |
| String quoting method. | |
| bool | modify_strings_ |
| On/off switch for modification of strings. | |
| bool | newline_ |
| Are we at the beginning of a line? (Otherwise, insert separator before next item.). | |
Stream class for writing to comma/tab/...-separated values files.
Automatically inserts separators between items and handles quoting of strings. Requires std::endl as the line delimiter - "\n" won't be accepted.
| SVOutStream | ( | std::ostream & | out, | |
| const String & | sep = "\t", |
|||
| const String & | replacement = "_", |
|||
| String::QuotingMethod | quoting = String::DOUBLE | |||
| ) |
Constructor.
| out | Output stream to write to (open file or cout) | |
| sep | Separator string (typically comma, semicolon, or tab) | |
| replacement | If quoting is NONE, used to replace occurrences of sep within strings before writing them | |
| quoting | Quoting method for strings (see String::quote) |
| bool modifyStrings | ( | bool | modify | ) |
Switch modification of strings (quoting/replacing of separators) on/off.
| SVOutStream& operator<< | ( | String | str | ) |
Stream output operator for String.
The argument is quoted before writing; it must not contain the newline character
| SVOutStream& operator<< | ( | const std::string & | str | ) |
Stream output operator for std::string.
The argument is quoted before writing; it must not contain the newline character
| SVOutStream& operator<< | ( | const char | c | ) |
Stream output operator for char.
The argument is quoted before writing; it must not contain the newline character
| SVOutStream& operator<< | ( | const T & | value | ) | [inline] |
Generic stream output operator (for non-character-based types).
| SVOutStream& operator<< | ( | std::ostream &(*)(std::ostream &) | fp | ) |
Stream output operator for manipulators (used to catch std::endl).
| SVOutStream& operator<< | ( | const char * | c_str | ) |
Stream output operator for char*.
The argument is quoted before writing; it must not contain the newline character
| SVOutStream& write | ( | const String & | str | ) |
Unformatted output (no quoting: useful for comments, but use only on a line of its own!).
| SVOutStream& writeValueOrNan | ( | NumericT | thing | ) | [inline] |
Write a numeric value or "nan"/"inf"/"-inf", if applicable (would not be needed for Linux).
References OpenMS::operator<<().
bool modify_strings_ [protected] |
On/off switch for modification of strings.
bool newline_ [protected] |
Are we at the beginning of a line? (Otherwise, insert separator before next item.).
String::QuotingMethod quoting_ [protected] |
String quoting method.
String replacement_ [protected] |
Replacement for separator.
| OpenMS / TOPP release 1.10.0 | Documentation generated on Thu Mar 7 2013 09:42:54 using doxygen 1.7.1 |