ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ConsoleWrapper Class Reference

#include <Consoles.h>

Public Member Functions

 ConsoleWrapper (std::function< void(const QString &)> printFn)
 
void write (const char *messagePart)
 
void flush () const
 

Detailed Description

Class implementing 'write' and flush to be able to act like a Python file object in order to be able to output messages from Python's print to the ACloudViewer console instead of ACloudViewer's stdout & stderr

Definition at line 22 of file Consoles.h.

Constructor & Destructor Documentation

◆ ConsoleWrapper()

ConsoleWrapper::ConsoleWrapper ( std::function< void(const QString &)>  printFn)
inlineexplicit

printFn: callback function that will be called by this wrapper this callback function shall display the received QString somewhere

Definition at line 27 of file Consoles.h.

Member Function Documentation

◆ flush()

void ConsoleWrapper::flush ( ) const
inline

Definition at line 65 of file Consoles.h.

Referenced by ccConsoleOutput::flush(), and ListWidgetConsole::flush().

◆ write()

void ConsoleWrapper::write ( const char *  messagePart)
inline

Method called by the Python interpreter when something is written. This function will in turn call the printFn callback given to the constructor

This function splits the messagePart given by the Python interpreter using the newline ('
') character and call the printFn on each of these splits.

The goal of this is to ensure that each '
'-separated lines appears one one line on ACloudViewer's console output

Parameters
messagePartthe message that the Python interpreter sends us

Definition at line 43 of file Consoles.h.

Referenced by ccConsoleOutput::write(), and ListWidgetConsole::write().


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