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 class  LogLevel {
  INFO , WARNING , LOGLEVEL_ERROR , PROGRESS ,
  NUM
}
 
enum class  UpdateType {
  LED , SETTING , SETTING_INFO , HARDWARE ,
  PLUG , MEDIA , STATUS , EXTENSION ,
  SOUND_DEVICE , CONNECTOR , DEBUG_UPDT , NUM
}
 

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 auto getLevelStrings ()
 
static auto getUpdateStrings ()
 

Protected Member Functions

 CliComm ()=default
 
 ~CliComm ()=default
 

Detailed Description

Definition at line 13 of file CliComm.hh.

Member Enumeration Documentation

◆ LogLevel

enum class openmsx::CliComm::LogLevel
strong
Enumerator
INFO 
WARNING 
LOGLEVEL_ERROR 
PROGRESS 
NUM 

Definition at line 16 of file CliComm.hh.

◆ UpdateType

enum class openmsx::CliComm::UpdateType
strong
Enumerator
LED 
SETTING 
SETTING_INFO 
HARDWARE 
PLUG 
MEDIA 
STATUS 
EXTENSION 
SOUND_DEVICE 
CONNECTOR 
DEBUG_UPDT 
NUM 

Definition at line 23 of file CliComm.hh.

Constructor & Destructor Documentation

◆ CliComm()

openmsx::CliComm::CliComm ( )
protecteddefault

◆ ~CliComm()

openmsx::CliComm::~CliComm ( )
protecteddefault

Member Function Documentation

◆ getLevelStrings()

static auto openmsx::CliComm::getLevelStrings ( )
inlinestatic

Definition at line 95 of file CliComm.hh.

Referenced by openmsx::MessageCommand::tabCompletion(), and openmsx::toString().

◆ getUpdateStrings()

static auto openmsx::CliComm::getUpdateStrings ( )
inlinestatic

Definition at line 101 of file CliComm.hh.

Referenced by openmsx::toString().

◆ 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 89 of file CliComm.hh.

References printError(), and tmpStrCat().

◆ printError() [2/3]

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

Definition at line 71 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 79 of file CliComm.hh.

References printInfo(), and tmpStrCat().

◆ printInfo() [2/3]

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

Definition at line 65 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 74 of file CliComm.hh.

References printProgress().

◆ printProgress() [2/2]

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

Definition at line 22 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 84 of file CliComm.hh.

References printWarning(), and tmpStrCat().

◆ printWarning() [2/3]

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

Definition at line 68 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: