Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions

TextFile Class Reference
[File IO]

This class provides some basic file handling methods for text files. More...

#include <OpenMS/FORMAT/TextFile.h>

Inheritance diagram for TextFile:
StringList CsvFile

List of all members.

Public Member Functions

 TextFile ()
 Default constructor.
virtual ~TextFile ()
 destructor
 TextFile (const String &filename, bool trim_lines=false, Int first_n=-1)
 Constructor with filename.
void load (const String &filename, bool trim_lines=false, Int first_n=-1)
 Loads data from a text file.
void store (const String &filename)
 Writes the data to a file.

Detailed Description

This class provides some basic file handling methods for text files.


Constructor & Destructor Documentation

TextFile (  ) 

Default constructor.

virtual ~TextFile (  )  [virtual]

destructor

TextFile ( const String filename,
bool  trim_lines = false,
Int  first_n = -1 
)

Constructor with filename.

Parameters:
filename The input file name.
trim_lines Whether or not the lines are trimmed when reading them from file.
first_n If set, only first_n lines the lines from the beginning of the file are read.
Exceptions:
Exception::FileNotFound is thrown if the file could not be opened.

Member Function Documentation

void load ( const String filename,
bool  trim_lines = false,
Int  first_n = -1 
)

Loads data from a text file.

Parameters:
filename The input file name.
trim_lines Whether or not the lines are trimmed when reading them from file.
first_n If set, only first_n lines the lines from the beginning of the file are read.
Exceptions:
Exception::FileNotFound is thrown if the file could not be opened.
void store ( const String filename  ) 

Writes the data to a file.

Note:
this function uses unix-style linebreaks
Exceptions:
Exception::UnableToCreateFile is thrown if the file could not be created

Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::writeFeatureDebugInfo_().


OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:54 using doxygen 1.7.1