WARNING: USE THIS SOFTWARE AT YOUR OWN RISK! THIS IS EXPERIMENTAL SOFTWARE NOT INTENDED FOR PRODUCTION USE! Zuble is currently an early stage prototype. As such Zuble is minimally tested and inherently unstable. It is provided for experimental, development, and demonstration purposes only. Zuble QML Types   |  Zuble C++ Classes   |  Zuble Overview
Zuble  0.1
Zuble Framework C++/QML extension API
Public Slots | Signals | Public Member Functions | Protected Attributes | List of all members
Zbl::ZTextFeed Class Reference

This class provides a means of directing a text stream to listeners. More...

#include <ZTextFeed.h>

Inheritance diagram for Zbl::ZTextFeed:
Inheritance graph
[legend]
Collaboration diagram for Zbl::ZTextFeed:
Collaboration graph
[legend]

Public Slots

void send (const QString &text)
 
ZTextFeedflush ()
 

Signals

void dataReady (const QString &text)
 Sent when text in the internal buffer is being flushed. More...
 

Public Member Functions

 ZTextFeed ()
 
virtual ~ZTextFeed ()
 
ZTextFeedoperator<< (const QString &text)
 
ZTextFeedoperator<< (const char *text)
 
ZTextFeedoperator<< (const int i)
 
bool getFlushOnEOL ()
 
void setFlushOnEOL (bool bFlushOnEOL)
 

Protected Attributes

QString m_textbuf
 
bool m_bFlushEOL
 

Detailed Description

This class provides a means of directing a text stream to listeners.

Definition at line 50 of file ZTextFeed.h.

Constructor & Destructor Documentation

◆ ZTextFeed()

Zbl::ZTextFeed::ZTextFeed ( )

Definition at line 36 of file ZTextFeed.cpp.

◆ ~ZTextFeed()

Zbl::ZTextFeed::~ZTextFeed ( )
virtual

Definition at line 42 of file ZTextFeed.cpp.

Member Function Documentation

◆ dataReady

void Zbl::ZTextFeed::dataReady ( const QString &  text)
signal

Sent when text in the internal buffer is being flushed.

Referenced by flush().

◆ flush

ZTextFeed & Zbl::ZTextFeed::flush ( )
slot

Send the signal for listeners to copy the text buffer, then erase the text buffer. Upon return from this method the text buffer will be empty.

Definition at line 100 of file ZTextFeed.cpp.

Referenced by Zbl::tfendl().

◆ getFlushOnEOL()

bool Zbl::ZTextFeed::getFlushOnEOL ( )

Returns true if flush will be called automatically by tfendl function, false if flush must be called explicitly to transmit the buffer.

Definition at line 88 of file ZTextFeed.cpp.

Referenced by Zbl::tfendl().

◆ operator<<() [1/3]

ZTextFeed & Zbl::ZTextFeed::operator<< ( const QString &  text)

Stream operator for QString

Definition at line 60 of file ZTextFeed.cpp.

◆ operator<<() [2/3]

ZTextFeed & Zbl::ZTextFeed::operator<< ( const char *  text)

Stream operator for char*

Definition at line 71 of file ZTextFeed.cpp.

◆ operator<<() [3/3]

ZTextFeed & Zbl::ZTextFeed::operator<< ( const int  i)

Stream operator for int

Definition at line 79 of file ZTextFeed.cpp.

◆ send

void Zbl::ZTextFeed::send ( const QString &  text)
slot

Copies text into the text buffer where it will accumulate until flush or (optionally) tfendl is called.

Definition at line 46 of file ZTextFeed.cpp.

Referenced by operator<<(), Zbl::ZblApp::status(), and Zbl::tfendl().

◆ setFlushOnEOL()

void Zbl::ZTextFeed::setFlushOnEOL ( bool  bFlushOnEOL)

Set true to have flush called automatically by the tfendl function, or false to let text accumulate in the buffer until the flush function is explicitly called.

Definition at line 94 of file ZTextFeed.cpp.

Member Data Documentation

◆ m_bFlushEOL

bool Zbl::ZTextFeed::m_bFlushEOL
protected

True if calls to tfendl should cause an automatic flush of the buffer. False if an explicit call to flush() must occur before the buffer is flushed.

Definition at line 136 of file ZTextFeed.h.

Referenced by getFlushOnEOL(), and setFlushOnEOL().

◆ m_textbuf

QString Zbl::ZTextFeed::m_textbuf
protected

Text buffer filled by Send method.

Definition at line 129 of file ZTextFeed.h.

Referenced by flush(), and send().


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