35 #ifndef OPENMS_FORMAT_TEXTFILE_H 36 #define OPENMS_FORMAT_TEXTFILE_H 54 typedef std::vector<String>::iterator
Iterator;
81 TextFile(
const String& filename,
bool trim_lines =
false,
Int first_n = -1,
bool skip_empty_lines =
false);
93 void load(
const String& filename,
bool trim_lines =
false,
Int first_n = -1,
bool skip_empty_lines =
false);
102 void store(
const String& filename);
105 template <
typename StringType>
108 buffer_.push_back(static_cast<String>(
string));
112 template <
typename StringType>
115 buffer_.push_back(static_cast<String>(line));
121 ConstIterator begin()
const;
127 ConstIterator end()
const;
138 #endif // OPENMS_FORMAT_TEXTFILE_H A more convenient string class.
Definition: String.h:57
TextFile & operator<<(const StringType &string)
Operator for appending entries with less code.
Definition: TextFile.h:106
std::vector< String > buffer_
Internal buffer storing the lines before writing them to the file.
Definition: TextFile.h:133
std::vector< String >::reverse_iterator ReverseIterator
Mutable reverse iterator.
Definition: TextFile.h:59
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
std::vector< String >::iterator Iterator
Mutable iterator.
Definition: TextFile.h:55
std::vector< String >::const_iterator ConstIterator
Non-mutable iterator.
Definition: TextFile.h:57
void addLine(const StringType &line)
Definition: TextFile.h:113
std::vector< String >::const_reverse_iterator ConstReverseIterator
Non-mutable reverse iterator.
Definition: TextFile.h:61
int Int
Signed integer type.
Definition: Types.h:103
This class provides some basic file handling methods for text files.
Definition: TextFile.h:47