#include <OpenMS/FORMAT/TextFile.h>
Public Types | |
Type definitions | |
typedef iterator | Iterator |
Mutable iterator. | |
typedef const_iterator | ConstIterator |
Non-mutable iterator. | |
typedef reverse_iterator | ReverseIterator |
Mutable reverse iterator. | |
typedef const_reverse_iterator | ConstReverseIterator |
Non-mutable reverse iterator. | |
Public Member Functions | |
TextFile () | |
Default constructor. | |
virtual | ~TextFile () |
destructor | |
TextFile (const String &filename, bool trim_lines=false) throw (Exception::FileNotFound) | |
Constructor with filename. | |
void | load (const String &filename, bool trim_lines=false) throw (Exception::FileNotFound) |
Loads data from file. | |
void | store (const String &filename) throw (Exception::UnableToCreateFile) |
Writes the data to a file. | |
Iterator | search (const Iterator &start, const String &text, bool trim=false) |
Searches for the first line that starts with text beginning at line start . | |
Iterator | search (const String &text, bool trim=false) |
Searches for the first line that starts with text . | |
Iterator | searchSuffix (const Iterator &start, const String &text, bool trim=false) |
Searches for the first line that ends with text beginning at line start . | |
Iterator | searchSuffix (const String &text, bool trim=false) |
Searches for the first line that ends with text . | |
ConstIterator | search (const ConstIterator &start, const String &text, bool trim=false) const |
Searches for the first line that starts with text beginning at line start . | |
ConstIterator | search (const String &text, bool trim=false) const |
Searches for the first line that starts with text . | |
ConstIterator | searchSuffix (const ConstIterator &start, const String &text, bool trim=false) const |
Searches for the first line that ends with text beginning at line start . | |
ConstIterator | searchSuffix (const String &text, bool trim=false) const |
Searches for the first line that ends with text . | |
String | asString () const |
Return the content as a single String. |
typedef iterator Iterator |
Mutable iterator.
typedef const_iterator ConstIterator |
Non-mutable iterator.
typedef reverse_iterator ReverseIterator |
Mutable reverse iterator.
typedef const_reverse_iterator ConstReverseIterator |
Non-mutable reverse iterator.
TextFile | ( | ) |
Default constructor.
virtual ~TextFile | ( | ) | [virtual] |
destructor
TextFile | ( | const String & | filename, | |
bool | trim_lines = false | |||
) | throw (Exception::FileNotFound) |
Constructor with filename.
filename | the filename | |
trim_lines | wether or not the lines are trimmed when reading them from file |
void load | ( | const String & | filename, | |
bool | trim_lines = false | |||
) | throw (Exception::FileNotFound) |
Loads data from file.
filename | the filename | |
trim_lines | wether or not the lines are trimmed when reading them from file |
void store | ( | const String & | filename | ) | throw (Exception::UnableToCreateFile) |
Writes the data to a file.
Note that this function uses unix-style linebreaks
filename | the filename |
Searches for the first line that starts with text
beginning at line start
.
start | the line to start the search in | |
text | the text to find | |
trim | wether the line is trimmed before |
Searches for the first line that starts with text
.
This is an overloaded member function, provided for convenience.
It behaves essentially like the above function but the search is start at the beginning of the file
Searches for the first line that ends with text
beginning at line start
.
start | the line to start the search in | |
text | the text to find | |
trim | wether the line is trimmed before |
Searches for the first line that ends with text
.
This is an overloaded member function, provided for convenience.
It behaves essentially like searchSuffix(const Iterator&, const String&, bool) but the search starts at the beginning of the file
ConstIterator search | ( | const ConstIterator & | start, | |
const String & | text, | |||
bool | trim = false | |||
) | const |
Searches for the first line that starts with text
beginning at line start
.
start | the line to start the search in | |
text | the text to find | |
trim | wether the line is trimmed before |
ConstIterator search | ( | const String & | text, | |
bool | trim = false | |||
) | const |
Searches for the first line that starts with text
.
This is an overloaded member function, provided for convenience.
It behaves essentially like the above function but the search is start at the beginning of the file
ConstIterator searchSuffix | ( | const ConstIterator & | start, | |
const String & | text, | |||
bool | trim = false | |||
) | const |
Searches for the first line that ends with text
beginning at line start
.
start | the line to start the search in | |
text | the text to find | |
trim | wether the line is trimmed before |
ConstIterator searchSuffix | ( | const String & | text, | |
bool | trim = false | |||
) | const |
Searches for the first line that ends with text
.
This is an overloaded member function, provided for convenience.
It behaves essentially like searchSuffix(const Iterator&, const String&, bool) but the search starts at the beginning of the file
Generated Tue Apr 1 15:36:45 2008 -- using doxygen 1.5.4 | OpenMS / TOPP 1.1 |