odsstream
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TsvDirectoryWriter Class Reference
Inheritance diagram for TsvDirectoryWriter:
CalcWriterInterface TsvOutputStream ZipTsvOutputStream

Public Member Functions

 TsvDirectoryWriter (const QDir &directory)
 
virtual void close () override
 
virtual void writeSheet (const QString &sheetName) override
 open a new sheet
 
void writeLine () override
 open a new line
 
void writeCell (const char *) override
 write a text cell
 
void writeCell (const QString &) override
 write a text cell
 
void writeEmptyCell () override
 write an empty cell
 
void writeCell (std::size_t) override
 write an unsigned integer in a cell
 
void writeCell (int) override
 write an integer in a cell
 
void writeCell (float) override
 write a float in a cell
 
void writeCell (double) override
 write a double in a cell
 
void writeCellPercentage (double value) override
 write a double as a percentage
 
void writeCell (bool) override
 write a boolean in a cell
 
void writeCell (const QDate &) override
 write a date in a cell
 
void writeCell (const QDateTime &) override
 write a timestamp in a cell
 
void writeCell (const QUrl &, const QString &) override
 write a text cell with an URL link
 
void setCellAnnotation (const QString &annotation) override
 set annotation to write in the next cell
 
void setSeparator (TsvSeparator separator)
 sets the separator to use between values (cells)
 
TsvSeparator getSeparator () const
 get the separator used between values (cells)
 
bool setQuoteStrings (bool quote_strings)
 set a flag to quote strings
 
bool isQuoteStrings () const
 tells if the quote string flag is enabled
 
bool setFlushLines (bool flushOk)
 enable a physical flush on device at each new line enables this if you want to ensure that each line is written. This costs a little overhead
 
bool isFlushLines () const
 tells if the flush lines flag is enabled
 
- Public Member Functions inherited from CalcWriterInterface
virtual OdsTableCellStyleRef getTableCellStyleRef (const OdsTableCellStyle &style)
 
virtual void setTableCellStyleRef (OdsTableCellStyleRef style_ref)
 
void clearTableCellStyleRef ()
 
virtual void addColorScale (const OdsColorScale &ods_color_scale)
 apply solor scale conditional format on a cell range
 
virtual QString getOdsCellCoordinate ()
 get the last written cell coordinate in ODS coordinate format get the coordinate of the last written cell or an empty string if the writer is not an OdsDocWriter
 
virtual void setCurrentOdsTableSettings (const OdsTableSettings &settings)
 set ODS table settings of the current sheet (table)
 

Protected Member Functions

void writeRawCell (const QString &text)
 
void initializeSheet ()
 

Protected Attributes

QString m_separator = "\t"
 
QString _end_of_line = "\n"
 
QTextStream * mpa_otxtstream = nullptr
 
unsigned int numFloatPrecision = 12
 

Member Function Documentation

◆ close()

void TsvDirectoryWriter::close ( )
overridevirtual

Implements CalcWriterInterface.

◆ getSeparator()

TsvSeparator TsvDirectoryWriter::getSeparator ( ) const

get the separator used between values (cells)

Returns
TsvSeparator used

◆ setCellAnnotation()

void TsvDirectoryWriter::setCellAnnotation ( const QString &  annotation)
inlineoverridevirtual

set annotation to write in the next cell

Parameters
annotationany comment on this cell

Implements CalcWriterInterface.

◆ setFlushLines()

bool TsvDirectoryWriter::setFlushLines ( bool  flushOk)

enable a physical flush on device at each new line enables this if you want to ensure that each line is written. This costs a little overhead

Parameters
boolif true, lines will be flushed, choose false otherwise
Returns
bool state of the modified flag

◆ setQuoteStrings()

bool TsvDirectoryWriter::setQuoteStrings ( bool  quote_strings)

set a flag to quote strings

Parameters
boolif true, strings will be quoted, choose false otherwise
Returns
bool state of the modified flag

◆ setSeparator()

void TsvDirectoryWriter::setSeparator ( TsvSeparator  separator)

sets the separator to use between values (cells)

Parameters
TsvSeparatorenumeration to choose between possible choices

◆ writeCell() [1/10]

void TsvDirectoryWriter::writeCell ( bool  true_or_false)
overridevirtual

write a boolean in a cell

Parameters
true_or_falseboolean to write

Implements CalcWriterInterface.

◆ writeCell() [2/10]

void TsvDirectoryWriter::writeCell ( const char *  cell_text)
overridevirtual

write a text cell

Parameters
cell_textcell text

Implements CalcWriterInterface.

◆ writeCell() [3/10]

void TsvDirectoryWriter::writeCell ( const QDate &  date)
overridevirtual

write a date in a cell

Parameters
datedate to write

Implements CalcWriterInterface.

◆ writeCell() [4/10]

void TsvDirectoryWriter::writeCell ( const QDateTime &  datetime)
overridevirtual

write a timestamp in a cell

Parameters
datetimetimestamp to write

Implements CalcWriterInterface.

◆ writeCell() [5/10]

void TsvDirectoryWriter::writeCell ( const QString &  cell_text)
overridevirtual

write a text cell

Parameters
cell_textcell text

Implements CalcWriterInterface.

◆ writeCell() [6/10]

void TsvDirectoryWriter::writeCell ( const QUrl &  url_link,
const QString &  text 
)
overridevirtual

write a text cell with an URL link

Parameters
url_linkURL link
texttext to write

Implements CalcWriterInterface.

◆ writeCell() [7/10]

void TsvDirectoryWriter::writeCell ( double  number)
overridevirtual

write a double in a cell

Parameters
numberdouble to write

Implements CalcWriterInterface.

◆ writeCell() [8/10]

void TsvDirectoryWriter::writeCell ( float  number)
overridevirtual

write a float in a cell

Parameters
numberfloat to write

Implements CalcWriterInterface.

◆ writeCell() [9/10]

void TsvDirectoryWriter::writeCell ( int  number)
overridevirtual

write an integer in a cell

Parameters
numberinteger to write

Implements CalcWriterInterface.

◆ writeCell() [10/10]

void TsvDirectoryWriter::writeCell ( std::size_t  number)
overridevirtual

write an unsigned integer in a cell

Parameters
numberinteger to write

Implements CalcWriterInterface.

◆ writeCellPercentage()

void TsvDirectoryWriter::writeCellPercentage ( double  value)
overridevirtual

write a double as a percentage

Parameters
numberdouble to write must be a ratio (0.5 == 50%)

Implements CalcWriterInterface.

◆ writeEmptyCell()

void TsvDirectoryWriter::writeEmptyCell ( )
overridevirtual

write an empty cell

Implements CalcWriterInterface.

◆ writeLine()

void TsvDirectoryWriter::writeLine ( )
overridevirtual

open a new line

Implements CalcWriterInterface.

◆ writeSheet()

void TsvDirectoryWriter::writeSheet ( const QString &  sheetName)
overridevirtual

open a new sheet

Parameters
sheetNamethe sheet name

Implements CalcWriterInterface.

Reimplemented in TsvOutputStream, and ZipTsvOutputStream.


The documentation for this class was generated from the following files: