Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

OmgFileWriter Class Reference
[Library]

#include <omgfilewriter.h>

Collaboration diagram for OmgFileWriter:

Collaboration graph
[legend]
List of all members.

Detailed Description

An OmgFileWriter is used to store the results of the climate data processor in a persistant manner.

Author:
Tim Sutton

Definition at line 33 of file omgfilewriter.h.

Public Types

enum  FileType { MATLAB, ESRI_ASCII, PLAIN }

Public Member Functions

 OmgFileWriter ()
 OmgFileWriter (const QString theFileName, FileType theFileFormat)
 ~OmgFileWriter ()
bool writeElement (float theElementFloat)
bool writeNoData ()
bool writeString (QString theQString)
const QString fileName ()
void close ()
bool sendLineBreak ()
bool isWriteable ()
QString seperator ()
void setSeperator (QString theQString)
void setInputNoData (float theValue)
void setOutputNoData (float theValue)

Private Attributes

QFile mFile
QTextStream mTextStream
QString seperatorString
QString fileNameString
bool isWriteableFlag
float mInputNoData
float mOutputNoData


Member Enumeration Documentation

enum OmgFileWriter::FileType
 

An enumerator defining the different types of output files that can be written.

Enumeration values:
MATLAB 
ESRI_ASCII 
PLAIN 

Definition at line 39 of file omgfilewriter.h.


Constructor & Destructor Documentation

OmgFileWriter::OmgFileWriter  ) 
 

Constructor

Definition at line 23 of file omgfilewriter.cpp.

References mInputNoData, and mOutputNoData.

OmgFileWriter::OmgFileWriter const QString  theFileName,
FileType  theFileFormat
 

Constructor

Parameters:
theFileName - a QString containing the name of the output file.
theFileFormat - the output format as defined in FileType.
See also:
FileType

Definition at line 31 of file omgfilewriter.cpp.

References fileNameString, isWriteableFlag, mFile, mTextStream, and seperatorString.

OmgFileWriter::~OmgFileWriter  ) 
 

Destructor

Definition at line 67 of file omgfilewriter.cpp.


Member Function Documentation

void OmgFileWriter::close  ) 
 

Close the currently open file.

Returns:
bool - indicating successor failure of the close operation.

Definition at line 126 of file omgfilewriter.cpp.

References mFile.

Referenced by OmgRasterThreshold::accept().

const QString OmgFileWriter::fileName  ) 
 

Read property of QString fileNameString.

Returns:
QString - containing the name of the file.

Definition at line 109 of file omgfilewriter.cpp.

References fileNameString.

Referenced by OmgRasterThreshold::accept(), and OmgClimateDataProcessorController::run().

bool OmgFileWriter::isWriteable  )  [inline]
 

Used to find out if this filewriter is writeable (it wont be if there was an error opening the file for writing.

Returns:
bool - flag indicating whether the file is writeable or not.

Definition at line 84 of file omgfilewriter.h.

bool OmgFileWriter::sendLineBreak  ) 
 

This method sends a line break to the output file.

Returns:
bool - indicating successor failure of the write operation.

Definition at line 117 of file omgfilewriter.cpp.

References mTextStream.

Referenced by OmgRasterThreshold::accept().

QString OmgFileWriter::seperator  )  [inline]
 

Accessor for the seperator between numbers written to the file.

Returns:
QString - the separated currently in use.

Definition at line 89 of file omgfilewriter.h.

void OmgFileWriter::setInputNoData float  theValue  ) 
 

Mutator for input no data value

Definition at line 141 of file omgfilewriter.cpp.

References mInputNoData.

void OmgFileWriter::setOutputNoData float  theValue  ) 
 

Mutator for output no data value

Definition at line 147 of file omgfilewriter.cpp.

References mOutputNoData.

void OmgFileWriter::setSeperator QString  theQString  )  [inline]
 

Mutator for the seperator between numbers in a file.

Parameters:
theQString - the new seperator to be used.

Definition at line 93 of file omgfilewriter.h.

bool OmgFileWriter::writeElement float  theElementFloat  ) 
 

Write a float element to the output file.

Parameters:
theElementFloat - the variable that is to be written off to file.
Returns:
bool - indicating success or failure of the write operation.

Definition at line 71 of file omgfilewriter.cpp.

References mInputNoData, mOutputNoData, mTextStream, and seperatorString.

Referenced by OmgRasterThreshold::accept(), and OmgClimateDataProcessorController::run().

bool OmgFileWriter::writeNoData  ) 
 

Write a ouput nodata element to the output file.

Returns:
bool - indicating success or failure of the write operation.

Definition at line 102 of file omgfilewriter.cpp.

References mOutputNoData, mTextStream, and seperatorString.

bool OmgFileWriter::writeString QString  theQString  ) 
 

Write a header to the output file.

Parameters:
theString - the variable that is to be written off to file.
Returns:
bool - indicating successor failure of the write operation.

Definition at line 131 of file omgfilewriter.cpp.

References mTextStream.

Referenced by OmgRasterThreshold::accept(), and OmgClimateDataProcessorController::run().


Member Data Documentation

QString OmgFileWriter::fileNameString [private]
 

The filename that is being written to

Definition at line 112 of file omgfilewriter.h.

Referenced by fileName(), and OmgFileWriter().

bool OmgFileWriter::isWriteableFlag [private]
 

State of the filewriter - file open etc errors will mke the writeable state false.

Definition at line 116 of file omgfilewriter.h.

Referenced by OmgFileWriter().

QFile OmgFileWriter::mFile [private]
 

The file handle containing our output data matrix.

Definition at line 103 of file omgfilewriter.h.

Referenced by close(), and OmgFileWriter().

float OmgFileWriter::mInputNoData [private]
 

The no data value that may be passed in to write element

Definition at line 119 of file omgfilewriter.h.

Referenced by OmgFileWriter(), setInputNoData(), and writeElement().

float OmgFileWriter::mOutputNoData [private]
 

The no data value that should be written out by write element

Definition at line 121 of file omgfilewriter.h.

Referenced by OmgFileWriter(), setOutputNoData(), writeElement(), and writeNoData().

QTextStream OmgFileWriter::mTextStream [private]
 

A text stream associated with the output file that will be used when writing data to the file.

Definition at line 106 of file omgfilewriter.h.

Referenced by OmgFileWriter(), sendLineBreak(), writeElement(), writeNoData(), and writeString().

QString OmgFileWriter::seperatorString [private]
 

Definition at line 109 of file omgfilewriter.h.

Referenced by OmgFileWriter(), writeElement(), and writeNoData().


The documentation for this class was generated from the following files:
Generated on Mon Apr 28 15:13:05 2008 for openModellerDesktop by  doxygen 1.4.1-20050210