openMSX
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
openmsx::CliComm Class Referenceabstract

#include <CliComm.hh>

Inheritance diagram for openmsx::CliComm:
Inheritance graph
[legend]

Public Types

enum  LogLevel {
  INFO , WARNING , LOGLEVEL_ERROR , PROGRESS ,
  NUM_LEVELS
}
 
enum  UpdateType {
  LED , SETTING , SETTING_INFO , HARDWARE ,
  PLUG , MEDIA , STATUS , EXTENSION ,
  SOUND_DEVICE , CONNECTOR , DEBUG_UPDT , NUM_UPDATES
}
 

Public Member Functions

virtual void log (LogLevel level, std::string_view message, float fraction=0.0f)=0
 Log a message with a certain priority level.
 
virtual void update (UpdateType type, std::string_view name, std::string_view value)=0
 
virtual void updateFiltered (UpdateType type, std::string_view name, std::string_view value)=0
 Same as update(), but checks that the value for type-name is the same as in the previous call.
 
void printInfo (std::string_view message)
 
void printWarning (std::string_view message)
 
void printError (std::string_view message)
 
void printProgress (std::string_view message, float fraction)
 
void printInfo (const char *message)
 
void printWarning (const char *message)
 
void printError (const char *message)
 
void printProgress (const char *message, float fraction)
 
template<typename... Args>
void printInfo (Args &&...args)
 
template<typename... Args>
void printWarning (Args &&...args)
 
template<typename... Args>
void printError (Args &&...args)
 

Static Public Member Functions

static std::span< const std::string_view, NUM_LEVELSgetLevelStrings ()
 
static std::span< const std::string_view, NUM_UPDATESgetUpdateStrings ()
 

Protected Member Functions

 CliComm ()=default
 
 ~CliComm ()=default
 

Detailed Description

Definition at line 11 of file CliComm.hh.

Member Enumeration Documentation

◆ LogLevel

Enumerator
INFO 
WARNING 
LOGLEVEL_ERROR 
PROGRESS 
NUM_LEVELS 

Definition at line 14 of file CliComm.hh.

◆ UpdateType

Enumerator
LED 
SETTING 
SETTING_INFO 
HARDWARE 
PLUG 
MEDIA 
STATUS 
EXTENSION 
SOUND_DEVICE 
CONNECTOR 
DEBUG_UPDT 
NUM_UPDATES 

Definition at line 21 of file CliComm.hh.

Constructor & Destructor Documentation

◆ CliComm()

openmsx::CliComm::CliComm ( )
protecteddefault

◆ ~CliComm()

openmsx::CliComm::~CliComm ( )
protecteddefault

Member Function Documentation

◆ getLevelStrings()

static std::span< const std::string_view, NUM_LEVELS > openmsx::CliComm::getLevelStrings ( )
inlinestatic

◆ getUpdateStrings()

static std::span< const std::string_view, NUM_UPDATES > openmsx::CliComm::getUpdateStrings ( )
inlinestatic

Definition at line 99 of file CliComm.hh.

◆ log()

virtual void openmsx::CliComm::log ( LogLevel  level,
std::string_view  message,
float  fraction = 0.0f 
)
pure virtual

Log a message with a certain priority level.

The 'fraction' parameter is only meaningful for 'level=PROGRESS'. See printProgress() for details.

Implemented in openmsx::GlobalCliComm, and openmsx::MSXCliComm.

Referenced by printError(), printInfo(), printProgress(), and printWarning().

◆ printError() [1/3]

template<typename... Args>
void openmsx::CliComm::printError ( Args &&...  args)
inline

Definition at line 87 of file CliComm.hh.

References printError(), and tmpStrCat().

◆ printError() [2/3]

void openmsx::CliComm::printError ( const char *  message)
inline

Definition at line 69 of file CliComm.hh.

References printError().

◆ printError() [3/3]

void openmsx::CliComm::printError ( std::string_view  message)

◆ printInfo() [1/3]

template<typename... Args>
void openmsx::CliComm::printInfo ( Args &&...  args)
inline

Definition at line 77 of file CliComm.hh.

References printInfo(), and tmpStrCat().

◆ printInfo() [2/3]

void openmsx::CliComm::printInfo ( const char *  message)
inline

Definition at line 63 of file CliComm.hh.

References printInfo().

◆ printInfo() [3/3]

void openmsx::CliComm::printInfo ( std::string_view  message)

◆ printProgress() [1/2]

void openmsx::CliComm::printProgress ( const char *  message,
float  fraction 
)
inline

Definition at line 72 of file CliComm.hh.

References printProgress().

◆ printProgress() [2/2]

void openmsx::CliComm::printProgress ( std::string_view  message,
float  fraction 
)

Definition at line 20 of file CliComm.cc.

References log(), and PROGRESS.

Referenced by printProgress().

◆ printWarning() [1/3]

template<typename... Args>
void openmsx::CliComm::printWarning ( Args &&...  args)
inline

Definition at line 82 of file CliComm.hh.

References printWarning(), and tmpStrCat().

◆ printWarning() [2/3]

void openmsx::CliComm::printWarning ( const char *  message)
inline

Definition at line 66 of file CliComm.hh.

References printWarning().

◆ printWarning() [3/3]

void openmsx::CliComm::printWarning ( std::string_view  message)

◆ update()

virtual void openmsx::CliComm::update ( UpdateType  type,
std::string_view  name,
std::string_view  value 
)
pure virtual

◆ updateFiltered()

virtual void openmsx::CliComm::updateFiltered ( UpdateType  type,
std::string_view  name,
std::string_view  value 
)
pure virtual

Same as update(), but checks that the value for type-name is the same as in the previous call.

If so do nothing.

Implemented in openmsx::GlobalCliComm, and openmsx::MSXCliComm.

Referenced by openmsx::Setting::notifyPropertyChange().


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